Skip to content

Commit 534433d

Browse files
Fix error
1 parent bd9d919 commit 534433d

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

internal/datastore/src/letter-repository.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ export class LetterRepository {
123123
expressionAttributeValues[':reasonText'] = reasonText;
124124
}
125125

126-
// , reasonCode = :reasonCode, reasonText = :reasonText'
127126
result = await this.ddbClient.send(new UpdateCommand({
128127
TableName: this.config.lettersTableName,
129128
Key: {

lambdas/api-handler/src/services/letter-operations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const patchLetterStatus = async (letterToUpdate: LetterApiResource, lette
2222
updatedLetter = await letterRepo.updateLetterStatus(supplierId, letterId, letterToUpdate.attributes.status,
2323
letterToUpdate.attributes.reasonCode, letterToUpdate.attributes.reasonText);
2424
} catch (error) {
25-
if (error instanceof Error && error.message.includes('not found')) {
25+
if (error instanceof Error && /^Letter with id \w+ not found for supplier \w+$/.test(error.message)) {
2626
throw new NotFoundError(ApiErrorDetail.NotFoundLetterId);
2727
}
2828
throw error;

0 commit comments

Comments
 (0)