Skip to content

Commit 891c885

Browse files
committed
fix: webhook ui
1 parent 8960661 commit 891c885

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

dashboard/package-lock.json

Lines changed: 8 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dashboard/src/components/Menu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
FiMenu,
3131
FiUsers,
3232
FiChevronDown,
33-
FiAnchor,
33+
FiLink,
3434
} from 'react-icons/fi';
3535
import { BiCustomize } from 'react-icons/bi';
3636
import { AiOutlineKey } from 'react-icons/ai';
@@ -112,7 +112,7 @@ const LinkItems: Array<LinkItemProps> = [
112112
],
113113
},
114114
{ name: 'Users', icon: FiUsers, route: '/users' },
115-
{ name: 'Webhooks', icon: FiAnchor, route: '/webhooks' },
115+
{ name: 'Webhooks', icon: FiLink, route: '/webhooks' },
116116
];
117117

118118
interface SidebarProps extends BoxProps {

dashboard/src/components/UpdateWebhookModal.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ interface validatorDataType {
8484
const initWebhookData: webhookDataType = {
8585
[WebhookInputDataFields.EVENT_NAME]: webhookEventNames.USER_LOGIN,
8686
[WebhookInputDataFields.ENDPOINT]: '',
87-
[WebhookInputDataFields.ENABLED]: false,
87+
[WebhookInputDataFields.ENABLED]: true,
8888
[WebhookInputDataFields.HEADERS]: [{ ...initHeadersData }],
8989
};
9090

@@ -335,7 +335,10 @@ const UpdateWebhookModal = ({
335335
setVerifyingEndpoint(true);
336336
const { [WebhookInputDataFields.ENABLED]: _, ...params } = getParams();
337337
const res = await client.mutation(TestEndpoint, { params }).toPromise();
338-
if (res.data?._test_endpoint?.response?.success) {
338+
if (
339+
res.data?._test_endpoint?.http_status >= 200 &&
340+
res.data?._test_endpoint?.http_status < 400
341+
) {
339342
setVerifiedStatus(webhookVerifiedStatus.VERIFIED);
340343
} else {
341344
setVerifiedStatus(webhookVerifiedStatus.NOT_VERIFIED);

0 commit comments

Comments
 (0)