Skip to content

Commit

Permalink
Update client.ts (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-tey authored May 9, 2024
1 parent 6120cca commit dc1cf98
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export class Tinybird {
public buildIngestEndpoint<TSchema extends z.ZodSchema<any>>(req: {
datasource: string;
event: TSchema;
wait?: boolean
}): (
events: z.input<TSchema> | z.input<TSchema>[],
) => Promise<z.infer<typeof eventIngestReponseData>> {
Expand All @@ -138,6 +139,10 @@ export class Tinybird {
const url = new URL("/v0/events", this.baseUrl);
url.searchParams.set("name", req.datasource);

if (wait) {

Check failure on line 142 in src/client.ts

View workflow job for this annotation

GitHub Actions / Release

Cannot find name 'wait'.

Check failure on line 142 in src/client.ts

View workflow job for this annotation

GitHub Actions / Release

Cannot find name 'wait'.
url.searchParams.set("wait", "true");
}

const body = (Array.isArray(validatedEvents) ? validatedEvents : [validatedEvents])
.map((p) => JSON.stringify(p))
.join("\n");
Expand Down

0 comments on commit dc1cf98

Please sign in to comment.