break out user subscriptions
This commit is contained in:
parent
0d4a225442
commit
58c1980786
@ -91,19 +91,22 @@ export default {
|
|||||||
AND "Item"."userId" <> $1 AND "Item".created_at <= $2
|
AND "Item"."userId" <> $1 AND "Item".created_at <= $2
|
||||||
${await filterClause(me, models)}
|
${await filterClause(me, models)}
|
||||||
ORDER BY "sortTime" DESC
|
ORDER BY "sortTime" DESC
|
||||||
LIMIT ${LIMIT}+$3)
|
|
||||||
UNION DISTINCT
|
|
||||||
(SELECT DISTINCT "Item".id::TEXT, "Item".created_at AS "sortTime", NULL::BIGINT as "earnedSats",
|
|
||||||
'FollowActivity' AS type
|
|
||||||
FROM "Item"
|
|
||||||
JOIN "UserSubscription" ON "Item"."userId" = "UserSubscription"."followeeId"
|
|
||||||
WHERE "UserSubscription"."followerId" = $1
|
|
||||||
AND "Item".created_at <= $2
|
|
||||||
-- Only show items that have been created since subscribing to the user
|
|
||||||
AND "Item".created_at >= "UserSubscription".created_at
|
|
||||||
${await filterClause(me, models)}
|
|
||||||
ORDER BY "sortTime" DESC
|
|
||||||
LIMIT ${LIMIT}+$3)`
|
LIMIT ${LIMIT}+$3)`
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
queries.push(
|
||||||
|
`(SELECT DISTINCT "Item".id::TEXT, "Item".created_at AS "sortTime", NULL::BIGINT as "earnedSats",
|
||||||
|
'FollowActivity' AS type
|
||||||
|
FROM "Item"
|
||||||
|
JOIN "UserSubscription" ON "Item"."userId" = "UserSubscription"."followeeId"
|
||||||
|
WHERE "UserSubscription"."followerId" = $1
|
||||||
|
AND "Item".created_at <= $2
|
||||||
|
-- Only show items that have been created since subscribing to the user
|
||||||
|
AND "Item".created_at >= "UserSubscription".created_at
|
||||||
|
${await filterClause(me, models)}
|
||||||
|
ORDER BY "sortTime" DESC
|
||||||
|
LIMIT ${LIMIT}+$3)`
|
||||||
)
|
)
|
||||||
|
|
||||||
if (meFull.noteMentions) {
|
if (meFull.noteMentions) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user