update: webhooks

This commit is contained in:
anik-ghosh-au7 2022-07-17 13:38:18 +05:30
parent 150b1e5712
commit 390846c85f

View File

@ -227,6 +227,7 @@ const UpdateWebhookModal = ({
[WebhookInputDataFields.ENDPOINT]:
webhook[WebhookInputDataFields.ENDPOINT],
[WebhookInputDataFields.ENABLED]: webhook[WebhookInputDataFields.ENABLED],
[WebhookInputDataFields.HEADERS]: {},
};
if (webhook[WebhookInputDataFields.HEADERS].length) {
const headers = webhook[WebhookInputDataFields.HEADERS].reduce(
@ -311,7 +312,10 @@ const UpdateWebhookModal = ({
.map(() => ({ ...initHeadersValidatorData })),
});
} else {
setWebhook({ ...rest, [WebhookInputDataFields.HEADERS]: [] });
setWebhook({
...rest,
[WebhookInputDataFields.HEADERS]: [{ ...initHeadersData }],
});
}
}
}, [view]);