Skip to content

Commit

Permalink
Fixes webhook updating logic (#21519)
Browse files Browse the repository at this point in the history
  • Loading branch information
YatsukBogdan1 authored Jan 19, 2023
1 parent 59ecaea commit ceb8a70
Showing 1 changed file with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,22 @@ export const WebHookForm: React.FC<WebHookFormProps> = ({ webhook }) => {
}
}
if (action === WebhookAction.Save) {
switch (await testWebhookAction(data)) {
case true: {
await updateWebhook(data);
break;
}
case false: {
registerNotification({
id: "settings.webhook.save.failed",
text: formatMessage({ id: "settings.webhook.save.failed" }),
type: ToastType.ERROR,
});
break;
if (data.webhook === "") {
await updateWebhook(data);
} else {
switch (await testWebhookAction(data)) {
case true: {
await updateWebhook(data);
break;
}
case false: {
registerNotification({
id: "settings.webhook.save.failed",
text: formatMessage({ id: "settings.webhook.save.failed" }),
type: ToastType.ERROR,
});
break;
}
}
}
}
Expand Down

0 comments on commit ceb8a70

Please sign in to comment.