Skip to content
Snippets Groups Projects
Commit 9191b17e authored by Elia AZAR's avatar Elia AZAR
Browse files

groups.ts -> privatePosts

parent 9415c987
No related branches found
No related tags found
No related merge requests found
...@@ -233,7 +233,7 @@ export class MessageModel { ...@@ -233,7 +233,7 @@ export class MessageModel {
* @async * @async
* @rights member of groups * @rights member of groups
*/ */
async getAllPrivatePosts(groups: GroupCollection): Promise<PrivatePost[]> { async getAllPrivatePosts(groups: GroupSet): Promise<PrivatePost[]> {
throw "Not implemented"; throw "Not implemented";
// let result = await knex('private_posts').select().whereIn('id', received_messages); // let result = await knex('private_posts').select().whereIn('id', received_messages);
......
...@@ -305,7 +305,10 @@ export abstract class Group { ...@@ -305,7 +305,10 @@ export abstract class Group {
*/ */
async privatePosts(args, context: Context, info): Promise<PrivatePost[]> { async privatePosts(args, context: Context, info): Promise<PrivatePost[]> {
if (context.models.auth.isMember(this.gid)) { if (context.models.auth.isMember(this.gid)) {
throw "Not implemented" //03/03/19
let res = new GroupSet();
res.add(this.gid);
return context.models.message.getAllPrivatePosts(res);
} }
throw new AuthenticationError("Not a member"); throw new AuthenticationError("Not a member");
} }
......
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