diff options
Diffstat (limited to 'server/models/activitypub/actor-follow.ts')
-rw-r--r-- | server/models/activitypub/actor-follow.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/models/activitypub/actor-follow.ts b/server/models/activitypub/actor-follow.ts index 8498692f0..fb3c4ef9d 100644 --- a/server/models/activitypub/actor-follow.ts +++ b/server/models/activitypub/actor-follow.ts | |||
@@ -574,8 +574,8 @@ export class ActorFollowModel extends Model<ActorFollowModel> { | |||
574 | } | 574 | } |
575 | 575 | ||
576 | const selections: string[] = [] | 576 | const selections: string[] = [] |
577 | if (distinct === true) selections.push('DISTINCT("Follows"."' + columnUrl + '") AS "url"') | 577 | if (distinct === true) selections.push('DISTINCT("Follows"."' + columnUrl + '") AS "selectionUrl"') |
578 | else selections.push('"Follows"."' + columnUrl + '" AS "url"') | 578 | else selections.push('"Follows"."' + columnUrl + '" AS "selectionUrl"') |
579 | 579 | ||
580 | selections.push('COUNT(*) AS "total"') | 580 | selections.push('COUNT(*) AS "total"') |
581 | 581 | ||
@@ -585,7 +585,7 @@ export class ActorFollowModel extends Model<ActorFollowModel> { | |||
585 | let query = 'SELECT ' + selection + ' FROM "actor" ' + | 585 | let query = 'SELECT ' + selection + ' FROM "actor" ' + |
586 | 'INNER JOIN "actorFollow" ON "actorFollow"."' + firstJoin + '" = "actor"."id" ' + | 586 | 'INNER JOIN "actorFollow" ON "actorFollow"."' + firstJoin + '" = "actor"."id" ' + |
587 | 'INNER JOIN "actor" AS "Follows" ON "actorFollow"."' + secondJoin + '" = "Follows"."id" ' + | 587 | 'INNER JOIN "actor" AS "Follows" ON "actorFollow"."' + secondJoin + '" = "Follows"."id" ' + |
588 | 'WHERE "actor"."id" = ANY ($actorIds) AND "actorFollow"."state" = \'accepted\' ' | 588 | 'WHERE "actor"."id" = ANY ($actorIds) AND "actorFollow"."state" = \'accepted\' AND "selectionUrl" IS NOT NULL ' |
589 | 589 | ||
590 | if (count !== undefined) query += 'LIMIT ' + count | 590 | if (count !== undefined) query += 'LIMIT ' + count |
591 | if (start !== undefined) query += ' OFFSET ' + start | 591 | if (start !== undefined) query += ' OFFSET ' + start |
@@ -599,7 +599,7 @@ export class ActorFollowModel extends Model<ActorFollowModel> { | |||
599 | } | 599 | } |
600 | 600 | ||
601 | const [ followers, [ dataTotal ] ] = await Promise.all(tasks) | 601 | const [ followers, [ dataTotal ] ] = await Promise.all(tasks) |
602 | const urls: string[] = followers.map(f => f.url) | 602 | const urls: string[] = followers.map(f => f.selectionUrl) |
603 | 603 | ||
604 | return { | 604 | return { |
605 | data: urls, | 605 | data: urls, |