From fb63f55e9d86c5533c8455497c7b154a18546b39 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Sun, 15 Sep 2024 01:17:32 +0000 Subject: fix: Fix deleting tags broken due to wrong column name --- packages/trpc/routers/tags.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'packages/trpc') diff --git a/packages/trpc/routers/tags.ts b/packages/trpc/routers/tags.ts index e76a09ec..a5d93213 100644 --- a/packages/trpc/routers/tags.ts +++ b/packages/trpc/routers/tags.ts @@ -107,7 +107,13 @@ export const tagsAppRouter = router({ bookmarkId: tagsOnBookmarks.bookmarkId, }) .from(tagsOnBookmarks) - .where(conditionFromInput(input, ctx.user.id)); + .where( + and( + eq(tagsOnBookmarks.tagId, input.tagId), + // Tag ownership is checked in the ensureTagOwnership middleware + // eq(bookmarkTags.userId, ctx.user.id), + ), + ); const res = await ctx.db .delete(bookmarkTags) -- cgit v1.2.3-70-g09d2