Skip to content

Commit

Permalink
get_account_posts_by_feed - names sorting should occur in first query
Browse files Browse the repository at this point in the history
  • Loading branch information
asuch authored and vogel76 committed Nov 8, 2024
1 parent 3da57a9 commit 05eb04c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ BEGIN
END IF;

IF _reblogged_by IS NOT NULL AND CARDINALITY(_reblogged_by) > 0 THEN
IF CARDINALITY(_reblogged_by) > 1 THEN
_reblogged_by = array_sort(_reblogged_by);
END IF;
_result = jsonb_set(_result, '{reblogged_by}', to_jsonb(_reblogged_by));
END IF;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ BEGIN
);

IF _reblogged_by IS NOT NULL AND CARDINALITY(_reblogged_by) > 0 THEN
IF CARDINALITY(_reblogged_by) > 1 THEN
_reblogged_by = array_sort(_reblogged_by);
END IF;
_result = jsonb_set(_result, '{reblogged_by}', to_jsonb(_reblogged_by));
END IF;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ BEGIN
SELECT
hfc.post_id,
MIN(hfc.created_at) as min_created,
array_agg(ha.name) AS reblogged_by,
array_agg(DISTINCT(ha.name) ORDER BY ha.name) AS reblogged_by,
array_agg(blacklist.source) as blacklist_source
FROM hivemind_app.hive_feed_cache hfc
JOIN hivemind_app.hive_follows hf ON hfc.account_id = hf.following
Expand Down

0 comments on commit 05eb04c

Please sign in to comment.