Skip to content

Commit ceb8a70

Browse files
Fixes webhook updating logic (#21519)
1 parent 59ecaea commit ceb8a70

File tree

1 file changed

+16
-12
lines changed
  • airbyte-webapp/src/pages/SettingsPage/pages/NotificationPage/components

1 file changed

+16
-12
lines changed

airbyte-webapp/src/pages/SettingsPage/pages/NotificationPage/components/WebHookForm.tsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,22 @@ export const WebHookForm: React.FC<WebHookFormProps> = ({ webhook }) => {
7676
}
7777
}
7878
if (action === WebhookAction.Save) {
79-
switch (await testWebhookAction(data)) {
80-
case true: {
81-
await updateWebhook(data);
82-
break;
83-
}
84-
case false: {
85-
registerNotification({
86-
id: "settings.webhook.save.failed",
87-
text: formatMessage({ id: "settings.webhook.save.failed" }),
88-
type: ToastType.ERROR,
89-
});
90-
break;
79+
if (data.webhook === "") {
80+
await updateWebhook(data);
81+
} else {
82+
switch (await testWebhookAction(data)) {
83+
case true: {
84+
await updateWebhook(data);
85+
break;
86+
}
87+
case false: {
88+
registerNotification({
89+
id: "settings.webhook.save.failed",
90+
text: formatMessage({ id: "settings.webhook.save.failed" }),
91+
type: ToastType.ERROR,
92+
});
93+
break;
94+
}
9195
}
9296
}
9397
}

0 commit comments

Comments
 (0)