Skip to content
This repository was archived by the owner on Mar 9, 2023. It is now read-only.

Commit 0c12494

Browse files
authored
Fix pagination (#3)
1 parent c1b4ab7 commit 0c12494

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const addApiKeyHeader = (
1010
bundle: Bundle
1111
): HttpRequestOptions => {
1212
req.headers ??= {};
13+
req.headers["Content-Type"] = "application/json";
1314
req.headers["Authorization"] = `Bearer ${bundle.authData.apiKey}`;
1415
return req;
1516
};

src/triggers/order.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const perform = async (z: ZObject, bundle: Bundle): Promise<unknown> => {
55
// zapier starts with page 0
66
const page = bundle.meta.page + 1;
77
const { data } = await z.request("https://api.usepatch.com/v1/orders", {
8-
json: { page },
8+
params: { page },
99
});
1010
return (data as PatchResponse).data;
1111
};

src/triggers/project.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const perform = async (z: ZObject, bundle: Bundle): Promise<unknown> => {
55
// zapier starts with page 0
66
const page = bundle.meta.page + 1;
77
const { data } = await z.request("https://api.usepatch.com/v1/projects", {
8-
json: { page },
8+
params: { page },
99
});
1010
return (data as PatchResponse).data;
1111
};

0 commit comments

Comments
 (0)