fix posts not showing up in bookmarks

This commit is contained in:
keyan 2024-02-14 09:11:34 -06:00
parent 30bc3b612a
commit 2ce2580e8e
1 changed files with 2 additions and 2 deletions

View File

@ -155,13 +155,13 @@ const relationClause = (type) => {
clause += ' FROM "Item" JOIN "Item" root ON "Item"."rootId" = root.id LEFT JOIN "Sub" ON "Sub"."name" = root."subName" '
break
case 'bookmarks':
clause += ' FROM "Item" JOIN "Item" root ON "Item"."rootId" = root.id JOIN "Bookmark" ON "Bookmark"."itemId" = "Item"."id" LEFT JOIN "Sub" ON "Sub"."name" = root."subName" '
clause += ' FROM "Item" JOIN "Bookmark" ON "Bookmark"."itemId" = "Item"."id" LEFT JOIN "Item" root ON "Item"."rootId" = root.id LEFT JOIN "Sub" ON "Sub"."name" = COALESCE(root."subName", "Item"."subName") '
break
case 'outlawed':
case 'borderland':
case 'freebies':
case 'all':
clause += ' FROM "Item" LEFT JOIN "Item" root ON "Item"."rootId" = root.id LEFT JOIN "Sub" ON "Sub"."name" = root."subName" '
clause += ' FROM "Item" LEFT JOIN "Item" root ON "Item"."rootId" = root.id LEFT JOIN "Sub" ON "Sub"."name" = COALESCE(root."subName", "Item"."subName") '
break
default:
clause += ' FROM "Item" LEFT JOIN "Sub" ON "Sub"."name" = "Item"."subName" '