From babecc3c09cd4ed06fe643a97fff4bcc31c5a9be Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Nov 2018 15:38:09 +0100 Subject: Fix AP collections pagination --- server/models/activitypub/actor-follow.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/models/activitypub/actor-follow.ts') diff --git a/server/models/activitypub/actor-follow.ts b/server/models/activitypub/actor-follow.ts index 3373355ef..0a6935083 100644 --- a/server/models/activitypub/actor-follow.ts +++ b/server/models/activitypub/actor-follow.ts @@ -509,12 +509,12 @@ export class ActorFollowModel extends Model { tasks.push(ActorFollowModel.sequelize.query(query, options)) } - const [ followers, [ { total } ] ] = await Promise.all(tasks) + const [ followers, [ dataTotal ] ] = await Promise.all(tasks) const urls: string[] = followers.map(f => f.url) return { data: urls, - total: parseInt(total, 10) + total: dataTotal ? parseInt(dataTotal.total, 10) : 0 } } -- cgit v1.2.3