Skip to content

Commit

Permalink
update id broken
Browse files Browse the repository at this point in the history
  • Loading branch information
tiffanyvu committed Jan 16, 2025
1 parent 61b4573 commit 913a52c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/lambda/update/updatePackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,14 @@ const sendUpdateIdMessage = async ({
}
// use event of current package to determine how ID should be formatted
const packageEvent = await getPackageType(currentPackage._id);
console.log(packageEvent, "PACKAGE EVENT?");
const packageSubmissionTypeSchema = events[packageEvent as keyof typeof events].baseSchema;
console.log(packageSubmissionTypeSchema, "SCHEMA???");

const idSchema = packageSubmissionTypeSchema.shape.id;
console.log(idSchema, "ID SCHEMA???");
const parsedId = idSchema.safeParse(updatedId);
console.log(parsedId, "PARSED IDDD");

if (!parsedId.success) {
return response({
Expand All @@ -132,6 +136,7 @@ const sendUpdateIdMessage = async ({
}

await sendDeleteMessage(currentPackage._id);
console.log("JUST DELETED");
await produceMessage(
topicName,
updatedId,
Expand Down

0 comments on commit 913a52c

Please sign in to comment.