fix: webhook ui
This commit is contained in:
@@ -30,7 +30,7 @@ import {
|
||||
FiMenu,
|
||||
FiUsers,
|
||||
FiChevronDown,
|
||||
FiAnchor,
|
||||
FiLink,
|
||||
} from 'react-icons/fi';
|
||||
import { BiCustomize } from 'react-icons/bi';
|
||||
import { AiOutlineKey } from 'react-icons/ai';
|
||||
@@ -112,7 +112,7 @@ const LinkItems: Array<LinkItemProps> = [
|
||||
],
|
||||
},
|
||||
{ name: 'Users', icon: FiUsers, route: '/users' },
|
||||
{ name: 'Webhooks', icon: FiAnchor, route: '/webhooks' },
|
||||
{ name: 'Webhooks', icon: FiLink, route: '/webhooks' },
|
||||
];
|
||||
|
||||
interface SidebarProps extends BoxProps {
|
||||
|
@@ -84,7 +84,7 @@ interface validatorDataType {
|
||||
const initWebhookData: webhookDataType = {
|
||||
[WebhookInputDataFields.EVENT_NAME]: webhookEventNames.USER_LOGIN,
|
||||
[WebhookInputDataFields.ENDPOINT]: '',
|
||||
[WebhookInputDataFields.ENABLED]: false,
|
||||
[WebhookInputDataFields.ENABLED]: true,
|
||||
[WebhookInputDataFields.HEADERS]: [{ ...initHeadersData }],
|
||||
};
|
||||
|
||||
@@ -335,7 +335,10 @@ const UpdateWebhookModal = ({
|
||||
setVerifyingEndpoint(true);
|
||||
const { [WebhookInputDataFields.ENABLED]: _, ...params } = getParams();
|
||||
const res = await client.mutation(TestEndpoint, { params }).toPromise();
|
||||
if (res.data?._test_endpoint?.response?.success) {
|
||||
if (
|
||||
res.data?._test_endpoint?.http_status >= 200 &&
|
||||
res.data?._test_endpoint?.http_status < 400
|
||||
) {
|
||||
setVerifiedStatus(webhookVerifiedStatus.VERIFIED);
|
||||
} else {
|
||||
setVerifiedStatus(webhookVerifiedStatus.NOT_VERIFIED);
|
||||
|
Reference in New Issue
Block a user