Skip to content

Commit

Permalink
validate id
Browse files Browse the repository at this point in the history
  • Loading branch information
tiffanyvu committed Jan 21, 2025
1 parent 83e96f9 commit e67222b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/lambda/submit/submitSplitSPA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ const sendSubmitSplitSPAMessage = async (currentPackage: ItemResult) => {
};

const splitSPAEventBodySchema = z.object({
packageId: z.string(),
packageId: z
.string()
.regex(
/^[A-Z]{2}-\d{2}-\d{4}(-[A-Z0-9]{1,4})?$/,
"ID doesn't match format SS-YY-NNNN or SS-YY-NNNN-XXXX",
),
});

export const handler = async (event: APIGatewayEvent) => {
Expand Down

0 comments on commit e67222b

Please sign in to comment.