Skip to content

Commit

Permalink
Merge branch 'main' into wfh/anno
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw committed Sep 18, 2024
2 parents 2f97893 + afbf1ae commit a71423a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions js/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3142,11 +3142,11 @@ export class Client {
);

let count = 0;
for await (const queue of this._getPaginated(
for await (const queues of this._getPaginated<AnnotationQueue>(
"/annotation-queues",
params
)) {
yield queue as unknown as AnnotationQueue;
yield* queues;
count++;
if (limit !== undefined && count >= limit) break;
}
Expand Down Expand Up @@ -3199,13 +3199,13 @@ export class Client {
*/
public async readAnnotationQueue(queueId: string): Promise<AnnotationQueue> {
// TODO: Replace when actual endpoint is added
const queue = await this.listAnnotationQueues({
const queueIteratorResult = await this.listAnnotationQueues({
queueIds: [queueId],
}).next();
if (queue.done) {
if (queueIteratorResult.done) {
throw new Error(`Annotation queue with ID ${queueId} not found`);
}
return queue.value;
return queueIteratorResult.value;
}

/**
Expand Down

0 comments on commit a71423a

Please sign in to comment.