Skip to content

Commit

Permalink
Switched to query vs body for del in delete/pages
Browse files Browse the repository at this point in the history
  • Loading branch information
azdak committed Dec 20, 2024
1 parent 18b0de2 commit aed6719
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/routes/deletePages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { jwtClaims } from '#src/app';
import { db, validateUuid } from '#src/utils';

export const deletePages = async ({ request, reply }) => {
const req = request.body;
const req = request.query;

if (!Array.isArray(req.pageIds)) {
return {
Expand All @@ -24,7 +24,7 @@ export const deletePages = async ({ request, reply }) => {

let deletedIds = [];
for (const url of req.pageIds) {
const deletedId = (await db.query(`
const deletedId = await (await db.query(`
DELETE FROM "urls" WHERE "id"=$1 AND "user_id"=$2 RETURNING "id"
`, [url, jwtClaims.sub])).rows.map(obj => obj.id);
deletedIds.push(deletedId);
Expand Down

0 comments on commit aed6719

Please sign in to comment.