Skip to content

Commit

Permalink
typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
adityachoudhari26 committed Nov 22, 2024
1 parent 7ae4a38 commit 959d44f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ export const PATCH = request()
{ status: 404 },
);

const t = await upsertResources(db, [_.merge(resource, body)]);

return NextResponse.json(t[0]);
const { updated } = await upsertResources(db, [_.merge(resource, body)]);
const res = updated.at(0);
if (res == null) throw new Error("Failed to update resource");
return NextResponse.json(res);
});

export const DELETE = request()
Expand Down

0 comments on commit 959d44f

Please sign in to comment.