Skip to content

Commit a1d4a36

Browse files
committed
comment: handle empty response
1 parent a44d6bc commit a1d4a36

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/app/src/TeamPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ export function CreateWebhookForm({
684684
onSuccess,
685685
}: {
686686
onClose: VoidFunction;
687-
onSuccess: (webhookId: string) => void;
687+
onSuccess: (webhookId?: string) => void;
688688
}) {
689689
const saveWebhook = api.useSaveWebhook();
690690

packages/app/src/components/Alerts.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ const WebhookChannelForm = <T extends object>(
4848
name: props.name!,
4949
});
5050

51-
const handleWebhookCreated = async (webhookId: string) => {
51+
const handleWebhookCreated = async (webhookId?: string) => {
5252
await refetchWebhooks();
53-
field.onChange(webhookId);
54-
field.onBlur();
53+
if (webhookId) {
54+
field.onChange(webhookId);
55+
field.onBlur();
56+
}
5557
close();
5658
};
5759

0 commit comments

Comments
 (0)