use json_agg to aggregate enum in db

This commit is contained in:
Hongbo Wu
2024-02-23 14:54:37 +08:00
parent df0bda9cb2
commit 510cd18b17

View File

@ -31,7 +31,7 @@ export const refreshAllFeeds = async (db: DataSource): Promise<boolean> => {
ARRAY_AGG(s.most_recent_item_date) AS "mostRecentItemDates",
ARRAY_AGG(coalesce(s.scheduled_at, NOW())) AS "scheduledDates",
ARRAY_AGG(s.last_fetched_checksum) AS checksums,
ARRAY_AGG(s.fetch_content_type) AS "fetchContentTypes",
JSON_AGG(s.fetch_content_type) AS "fetchContentTypes",
ARRAY_AGG(coalesce(s.folder, $3)) AS folders
FROM
omnivore.subscriptions s
@ -106,7 +106,7 @@ const updateSubscriptionGroup = async (
timestamp.getTime()
), // unix timestamp in milliseconds
userIds: group.userIds,
fetchContents: group.fetchContentTypes,
fetchContentTypes: group.fetchContentTypes,
folders: group.folders,
}