From 1e164cc94d7bad89625335a27f77a0a81f653eda Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Mon, 5 Dec 2022 23:01:34 -0800 Subject: [PATCH] temp --- package.json | 2 +- .../server/api/endpoints/users/lists/delete.ts | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index e0be34148..c5540850a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "12.119.0-calc.19-b3", + "version": "12.119.0-calc.19-b4", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/backend/src/server/api/endpoints/users/lists/delete.ts b/packages/backend/src/server/api/endpoints/users/lists/delete.ts index 5a7613c98..384b7d713 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/delete.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/delete.ts @@ -30,14 +30,18 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { - const userList = await UserLists.findOneBy({ - id: ps.listId, + while (await UserLists.findOneBy({ userId: user.id, - }); + }) != null) { + const userList = await UserLists.findOneBy({ + // id: ps.listId, + userId: user.id, + }); - if (userList == null) { - throw new ApiError(meta.errors.noSuchList); + if (userList == null) { + throw new ApiError(meta.errors.noSuchList); + } + + await UserLists.delete(userList.id); } - - await UserLists.delete(userList.id); });