@@ -233,10 +233,9 @@ export async function getLettersFromQueueViaIndex(
233233 const params = {
234234 TableName : LETTERQUEUE_TABLENAME ,
235235 IndexName : "queueSortOrder-index" ,
236- KeyConditionExpression :
237- "supplierId = :supplierId" ,
236+ KeyConditionExpression : "supplierId = :supplierId" ,
238237 ExpressionAttributeValues : {
239- ":supplierId" : supplierId
238+ ":supplierId" : supplierId ,
240239 } ,
241240 } ;
242241
@@ -263,37 +262,3 @@ export async function getLettersFromQueueViaIndex(
263262 return [ ] ;
264263 }
265264}
266-
267- // async getLetters(
268- // supplierId: string,
269- // limit: number,
270- // ): Promise<PendingLetter[]> {
271- // const letters: PendingLetter[] = [];
272- // let lastEvaluatedKey: Record<string, unknown> | undefined;
273-
274- // do {
275- // const result = await this.ddbClient.send(
276- // new QueryCommand({
277- // TableName: this.config.letterQueueTableName,
278- // IndexName: "queueSortOrder-index",
279- // KeyConditionExpression: "supplierId = :supplierId",
280- // FilterExpression: "visibilityTimestamp < :now",
281- // ExpressionAttributeValues: {
282- // ":supplierId": supplierId,
283- // ":now": new Date().toISOString(),
284- // },
285- // // 1000 is a compromise - a smaller number might result in a lot of round trips, a larger one might
286- // // entail fetching and then throwing away a lot of data
287- // Limit: this.config.queryPageSize ?? 1000,
288- // ExclusiveStartKey: lastEvaluatedKey,
289- // }),
290- // );
291-
292- // const page = z.array(PendingLetterSchema).parse(result.Items);
293- // letters.push(...page);
294-
295- // lastEvaluatedKey = result.LastEvaluatedKey;
296- // } while (lastEvaluatedKey !== undefined && letters.length < limit);
297-
298- // return letters.slice(0, limit);
299- // }
0 commit comments