Skip to content

Commit

Permalink
update response status codes
Browse files Browse the repository at this point in the history
  • Loading branch information
tiffanyvu committed Dec 11, 2024
1 parent 01d0e5c commit 266f791
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/lambda/update/updatePackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export const handler = async (event: APIGatewayEvent) => {
});
}
try {
// TODO: allow user to input title of the accordion
const { packageId, action, updatedFields, changeReason } =
typeof event.body === "string"
? JSON.parse(event.body)
Expand Down Expand Up @@ -68,7 +67,6 @@ export const handler = async (event: APIGatewayEvent) => {
origin: "mako",
}),
);
// delete/hide old record and create new one with new id but same values
}

if (action === "update-values") {
Expand All @@ -80,7 +78,7 @@ export const handler = async (event: APIGatewayEvent) => {

if (!areValidFields) {
return response({
statusCode: 500,
statusCode: 400,
body: {
message: `Cannot update invalid field(s)`,
},
Expand All @@ -89,7 +87,7 @@ export const handler = async (event: APIGatewayEvent) => {

if ("id" in updatedFields) {
return response({
statusCode: 500,
statusCode: 400,
body: { message: "ID is not a valid field to update" },
});
}
Expand Down

0 comments on commit 266f791

Please sign in to comment.