Skip to content

Commit

Permalink
chore: type error
Browse files Browse the repository at this point in the history
  • Loading branch information
UnderKoen committed Feb 13, 2024
1 parent b4c5d63 commit 6df2e06
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions src/PrintOne.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ export type RequestHandler = new (
token: string,
options: Required<PrintOneOptions>,
debug: debug.Debugger,
) => HttpHandler<string, unknown>;

) => HttpHandler<{ headers: Record<string, string> }, unknown>;
export type PrintOneOptions = Partial<{
url: string;
version: "v2";
Expand All @@ -55,18 +54,18 @@ export type Protected = {
};

export type OrderPaginatedQuery = PaginationOptions<
"createdAt" | "anonymizedAt" | "updatedAt" | "friendlyStatus" | "sendDate"
"createdAt" | "anonymizedAt" | "updatedAt" | "friendlyStatus" | "sendDate"
> & {
filter?: {
friendlyStatus?: InFilter<FriendlyStatus>;
billingId?: InFilter;
format?: InFilter<Format>;
// finish?: InFilter<Finish>;
isBillable?: boolean;
createdAt?: DateFilter;
anonymizedAt?: DateFilter | boolean;
csvId?: InFilter;
};
filter?: {
friendlyStatus?: InFilter<FriendlyStatus>;
billingId?: InFilter;
format?: InFilter<Format>;
// finish?: InFilter<Finish>;
isBillable?: boolean;
createdAt?: DateFilter;
anonymizedAt?: DateFilter | boolean;
csvId?: InFilter;
};
};

export class PrintOne {
Expand Down Expand Up @@ -280,18 +279,18 @@ export class PrintOne {
formData.append(
"orderData",
JSON.stringify({
sender: data.sender,
templateId,
finish: data.finish,
billingId: data.billingId,
sender: data.sender,
templateId,
finish: data.finish,
billingId: data.billingId,
}),
);

const response = await this.client.POST<{ id: string }>(
"orders/csv",
formData,
{
headers: {
headers: {
"Content-Type": "multipart/form-data",
},
},
Expand Down Expand Up @@ -341,7 +340,7 @@ export class PrintOne {
...params,
"filter.isBillable": `$eq:${options.filter.isBillable}`,
};
};
}

if (typeof options.filter?.anonymizedAt === "boolean") {
params = {
Expand Down

0 comments on commit 6df2e06

Please sign in to comment.