Skip to content

Commit 2fd858d

Browse files
committed
CCM-11602: GET Letters endpoint
1 parent f691d50 commit 2fd858d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

internal/datastore/src/letter-repository.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from '@aws-sdk/lib-dynamodb';
99
import { Letter, LetterSchema, LettersSchema } from './types';
1010
import { Logger } from 'pino';
11+
import { z } from 'zod';
1112

1213
export type PagingOptions = Partial<{
1314
exclusiveStartKey: Record<string, any>,
@@ -140,6 +141,10 @@ export class LetterRepository {
140141
':supplierStatus': `${supplierId}#${status}`
141142
}
142143
}));
143-
return LettersSchema.parse(result.Items);
144+
this.log({
145+
description: 'items',
146+
result,
147+
})
148+
return z.array(LetterSchema).parse(result.Items);
144149
}
145150
}

internal/datastore/src/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ export const LetterSchema = z.object({
3030
ttl: z.int()
3131
}).describe('Letter');
3232

33-
export const LettersSchema = z.array(LetterSchema);
34-
3533
/**
3634
* Letter is the type used for storing letters in the database.
3735
* The supplierStatus is a composite key combining supplierId and status.

0 commit comments

Comments
 (0)