From 3cd84078ea779640ca5046f6c66ba885cc45c2a3 Mon Sep 17 00:00:00 2001 From: Trivernis Date: Tue, 28 Jan 2020 11:48:43 +0100 Subject: [PATCH] Fix friends --- src/lib/models/User.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/models/User.ts b/src/lib/models/User.ts index dd4dfcf..1710d06 100644 --- a/src/lib/models/User.ts +++ b/src/lib/models/User.ts @@ -291,14 +291,16 @@ export class User extends Model { public async friends({first, offset}: { first: number, offset: number }): Promise { const limit = first ?? 10; offset = offset ?? 0; - return await this.$get("rFriendOf", {limit, offset}) as User[]; + const friendList = await this.$get("rFriendOf", {limit, offset}) as User[]; + friendList.concat(await this.$get("rFriends", {limit, offset}) as User[]); + return friendList.slice(0, limit); } /** * The total number of the users friends. */ public async friendCount(): Promise { - return this.$count("rFriends"); + return await this.$count("rFriends") + await this.$count("rFriendOf"); } /**