Skip to content
Snippets Groups Projects
Commit 9c0bbf15 authored by Olivér FACKLAM's avatar Olivér FACKLAM
Browse files

[Groups] likers

parent 4a731dd4
No related branches found
No related tags found
No related merge requests found
......@@ -74,6 +74,7 @@ export class SimpleGroup extends Group {
this.m_members = data.members;
this.m_speakers = data.speakers;
this.m_admins = data.admins;
this.m_likers = data.followers;
this.m_parents = data.parents;
......@@ -95,6 +96,7 @@ export class SimpleGroup extends Group {
protected m_members: string[]
protected m_speakers: string[]
protected m_admins: string[]
protected m_likers: string[]
protected m_parents: string[]
/**
......@@ -181,11 +183,16 @@ export class SimpleGroup extends Group {
*/
async likers(args, context: Context, info): Promise<User[]> {
if (context.models.auth.isViewer(this.gid)) {
throw "Not implemented";
return this.getLikers();
}
throw new AuthenticationError("Not a viewer");
}
async getLikers(): Promise<User[]> {
await this.m_loader.load();
return this.m_likers.map(uid => new User(uid));
}
/**
* @memberof GraphQL.SimpleGroup#
* @function frontPage
......
......@@ -282,10 +282,6 @@ export class User {
* @async
*/
async memberOf(args, context: Context, info): Promise<Group[]> {
return this.getMemberOf();
}
async getMemberOf(): Promise<Group[]> {
throw "Not implemented";
}
......@@ -358,10 +354,6 @@ export class User {
* @async
*/
async adminOf(args, context: Context, info): Promise<Group[]> {
return this.getAdminOf();
}
async getAdminOf(): Promise<Group[]> {
throw "Not implemented";
}
......@@ -434,10 +426,6 @@ export class User {
* @async
*/
async dislikes(args, context: Context, info): Promise<Group[]> {
return this.getDislikes();
}
async getDislikes(): Promise<Group[]> {
throw "Not implemented";
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment