Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: update project webhook types should not be empty (#6666)

h3n4lbcdfe5f1a2df
diff --git a/backend/api/v1/project_service.go b/backend/api/v1/project_service.go
index 1b34c6a58d..328a5c67b0 100644
--- a/backend/api/v1/project_service.go
+++ b/backend/api/v1/project_service.go
@@ -776,6 +776,9 @@ func (s *ProjectService) UpdateWebhook(ctx context.Context, request *v1pb.Update
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, err.Error())
}
+ if len(types) == 0 {
+ return nil, status.Errorf(codes.InvalidArgument, "notification types should not be empty")
+ }
update.ActivityList = types
default:
return nil, status.Errorf(codes.InvalidArgument, "invalid field %q", path)
diff --git a/frontend/src/components/ProjectWebhookForm.vue b/frontend/src/components/ProjectWebhookForm.vue
index bdcf4e13e5..aa47d505fd 100644
--- a/frontend/src/components/ProjectWebhookForm.vue
+++ b/frontend/src/components/ProjectWebhookForm.vue
@@ -263,7 +263,9 @@
v-else
type="submit"
class="btn-primary ml-3"
- :disabled="!valueChanged"
+ :disabled="
+ !valueChanged || state.webhook.notificationTypes.length === 0
+ "
@click.prevent="updateWebhook"
>
{{ $t("common.update") }}