Skip to content

Commit aed6719

Browse files
committed
Switched to query vs body for del in delete/pages
1 parent 18b0de2 commit aed6719

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/routes/deletePages.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { jwtClaims } from '#src/app';
22
import { db, validateUuid } from '#src/utils';
33

44
export const deletePages = async ({ request, reply }) => {
5-
const req = request.body;
5+
const req = request.query;
66

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

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

0 commit comments

Comments
 (0)