Skip to content

Commit

Permalink
Hotfix for updating/deleting things with id 0
Browse files Browse the repository at this point in the history
  • Loading branch information
n1kPLV committed Sep 4, 2023
1 parent f087d81 commit db4629c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Website/src/utils/webapi/handlers/deleteHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function deleteHandler<T = number>(
const realId = thingIdConverter(thingId);

// and check if it was valid.
if (!realId) {
if (realId == undefined) {
console.log("Can not delete thing: ", thingId, "is invalid");
return apiError(404);
}
Expand Down
2 changes: 1 addition & 1 deletion Website/src/utils/webapi/handlers/updateHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function updateHandler<TP, TI = number>(
const realId = thingIdConverter(thingId);

// and check if it was valid.
if (!realId) {
if (realId == undefined) {
console.log("Can not update thing: ", thingId, "is invalid");
return apiError(404);
}
Expand Down

0 comments on commit db4629c

Please sign in to comment.