From ba828da18a974cba1d87e5c51ff18946c24e682f Mon Sep 17 00:00:00 2001 From: Trivernis Date: Sun, 13 Oct 2019 18:30:19 +0200 Subject: [PATCH] Fixed friends - fixed friends field in gql api --- src/lib/models/User.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/models/User.ts b/src/lib/models/User.ts index 1c4d567..e9920ef 100644 --- a/src/lib/models/User.ts +++ b/src/lib/models/User.ts @@ -44,7 +44,7 @@ export class User extends Model { public rankpoints: number; @BelongsToMany(() => User, () => Friendship) - public friends: User[]; + public rFriends: User[]; @BelongsToMany(() => Post, () => PostVote) public votes: Array; @@ -78,6 +78,10 @@ export class User extends Model { return this.getDataValue("createdAt"); } + public async friends(): Promise { + return await this.$get("rFriends") as User[]; + } + public async chats(): Promise { return await this.$get("rChats") as ChatRoom[]; }