13233 zapier update route to create workflow apikey etc (#13239)

Fix webhook creation utils and some tests
This commit is contained in:
martmull
2025-07-16 16:23:35 +02:00
committed by GitHub
parent 5ba98475d4
commit 1fc087aeac
7 changed files with 130 additions and 66 deletions
@@ -18,13 +18,15 @@ export const performSubscribe = async (z: ZObject, bundle: Bundle) => {
operations: [
`${bundle.inputData.nameSingular}.${bundle.inputData.operation}`,
],
secret: '',
};
const result = await requestDb(
z,
bundle,
`mutation createWebhook {createWebhook(data:{${handleQueryParams(
`mutation createWebhook {createWebhook(input:{${handleQueryParams(
data,
)}}) {id}}`,
'metadata',
);
return result.data.createWebhook;
};
@@ -34,7 +36,8 @@ export const performUnsubscribe = async (z: ZObject, bundle: Bundle) => {
const result = await requestDb(
z,
bundle,
`mutation deleteWebhook {deleteWebhook(${handleQueryParams(data)}) {id}}`,
`mutation deleteWebhook {deleteWebhook(${handleQueryParams(data)})}`,
'metadata',
);
return result.data.deleteWebhook;
};