Fix zapier (#2735)

* Fix zapier tests

* Handle nested fields

* Code review returns
This commit is contained in:
martmull
2023-11-27 18:09:21 +01:00
committed by GitHub
parent e2e871ca32
commit a413b29dd4
10 changed files with 137 additions and 80 deletions

View File

@ -20,9 +20,9 @@ const requestDb = async (z: ZObject, bundle: Bundle, query: string) => {
const results = response.json;
if (results.errors) {
throw new z.errors.Error(
'The API Key you supplied is incorrect',
'AuthenticationError',
results.errors,
`query: ${query}, error: ${JSON.stringify(results.errors)}`,
'ApiError',
response.status
);
}
response.throwForStatus();
@ -30,9 +30,9 @@ const requestDb = async (z: ZObject, bundle: Bundle, query: string) => {
})
.catch((err) => {
throw new z.errors.Error(
'The API Key you supplied is incorrect',
'AuthenticationError',
err.message,
`query: ${query}, error: ${err.message}`,
'Error',
err.status
);
});
};