update: webhooks
This commit is contained in:
parent
913c5c94fb
commit
301bde4da2
|
@ -103,8 +103,8 @@ export const EmailVerificationQuery = `
|
|||
`;
|
||||
|
||||
export const WebhooksDataQuery = `
|
||||
query getWebhooksData {
|
||||
_webhooks{
|
||||
query getWebhooksData($params: PaginatedInput!) {
|
||||
_webhooks(params: $params){
|
||||
webhooks{
|
||||
id
|
||||
event_name
|
||||
|
|
|
@ -77,7 +77,16 @@ const Webhooks = () => {
|
|||
};
|
||||
const fetchWebookData = async () => {
|
||||
setLoading(true);
|
||||
const res = await client.query(WebhooksDataQuery).toPromise();
|
||||
const res = await client
|
||||
.query(WebhooksDataQuery, {
|
||||
params: {
|
||||
pagination: {
|
||||
limit: paginationProps.limit,
|
||||
page: paginationProps.page,
|
||||
},
|
||||
},
|
||||
})
|
||||
.toPromise();
|
||||
if (res.data?._webhooks) {
|
||||
const { pagination, webhooks } = res.data?._webhooks;
|
||||
const maxPages = getMaxPages(pagination);
|
||||
|
@ -97,12 +106,15 @@ const Webhooks = () => {
|
|||
}
|
||||
setLoading(false);
|
||||
};
|
||||
useEffect(() => {
|
||||
fetchWebookData();
|
||||
}, []);
|
||||
const paginationHandler = (value: Record<string, number>) => {
|
||||
setPaginationProps({ ...paginationProps, ...value });
|
||||
};
|
||||
useEffect(() => {
|
||||
fetchWebookData();
|
||||
}, []);
|
||||
React.useEffect(() => {
|
||||
fetchWebookData();
|
||||
}, [paginationProps.page, paginationProps.limit]);
|
||||
console.log('webhookData ==>> ', webhookData);
|
||||
return (
|
||||
<Box m="5" py="5" px="10" bg="white" rounded="md">
|
||||
|
|
Loading…
Reference in New Issue
Block a user