diff options
-rw-r--r-- | server/models/activitypub/actor-follow.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/models/activitypub/actor-follow.ts b/server/models/activitypub/actor-follow.ts index fb3c4ef9d..24272a40e 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 "selectionUrl"') | 577 | if (distinct === true) selections.push(`DISTINCT("Follows"."${columnUrl}") AS "selectionUrl"`) |
578 | else selections.push('"Follows"."' + columnUrl + '" AS "selectionUrl"') | 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\' AND "selectionUrl" IS NOT NULL ' | 588 | `WHERE "actor"."id" = ANY ($actorIds) AND "actorFollow"."state" = 'accepted' AND "Follows"."${columnUrl}" 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 |