From 4a43a9b864a81f5fe8f9640d473210e83b864270 Mon Sep 17 00:00:00 2001 From: keyan Date: Tue, 15 Mar 2022 11:30:11 -0500 Subject: [PATCH] don't group by more than id in notifications --- api/resolvers/notifications.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/resolvers/notifications.js b/api/resolvers/notifications.js index 8651cd20..ea28de4e 100644 --- a/api/resolvers/notifications.js +++ b/api/resolvers/notifications.js @@ -82,7 +82,7 @@ export default { AND "ItemAct".created_at <= $2 AND "ItemAct".act <> 'BOOST' AND "Item"."userId" = $1 - GROUP BY ${ITEM_GROUP_FIELDS} + GROUP BY "Item".id ORDER BY MAX("ItemAct".created_at) DESC LIMIT ${LIMIT}+$3) UNION ALL @@ -159,9 +159,9 @@ export default { // `subquery.id, subquery."createdAt", subquery."updatedAt", subquery.title, subquery.text, // subquery.url, subquery."userId", subquery."parentId", subquery.path` -const ITEM_GROUP_FIELDS = - `"Item".id, "Item".created_at, "Item".updated_at, "Item".title, - "Item".text, "Item".url, "Item"."userId", "Item"."parentId", ltree2text("Item"."path")` +// const ITEM_GROUP_FIELDS = +// `"Item".id, "Item".created_at, "Item".updated_at, "Item".title, +// "Item".text, "Item".url, "Item"."userId", "Item"."parentId", ltree2text("Item"."path")` // const ITEM_FIELDS = // `"Item".id, "Item".created_at as "createdAt", "Item".updated_at as "updatedAt", "Item".title,