Skip to content

Commit

Permalink
fix: update predictions.get function
Browse files Browse the repository at this point in the history
  • Loading branch information
shahrear33 committed Feb 12, 2025
1 parent 3107342 commit cc42a75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/client/predictions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ export class Predictions {
return response;
}

async get(params: { id: string }): Promise<PredictionResponse> {
async get(id: string): Promise<PredictionResponse> {
const [response] = await this.requestor.request<PredictionResponse>(
"GET",
`predictions/${params.id}`
`predictions/${id}`
);
return response;
}
Expand All @@ -53,7 +53,7 @@ export class Predictions {
const timeoutMs = timeout * 1000;

while (Date.now() - startTime < timeoutMs) {
const response = await this.get({ id });
const response = await this.get(id);
if (response.status === "completed") {
return response;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/client/predictions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ describe("Integration: Predictions", () => {
expect(waitResponse.response).toHaveProperty("items");

// Test get endpoint
const getResponse = await client.predictions.get({ id: result.id });
const getResponse = await client.predictions.get(result.id);
expect(getResponse.status).toBe("completed");
expect(getResponse.response).toHaveProperty("invoice_id");
});
Expand Down

0 comments on commit cc42a75

Please sign in to comment.