From 2e3e88467b74c3ccde1e5ca1f3835f58aad08d71 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 28 Jan 2020 14:00:19 +0100 Subject: [PATCH] Add group add on create group --- src/app/services/social/social.service.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/services/social/social.service.ts b/src/app/services/social/social.service.ts index 7fda50a..7cc3fc9 100644 --- a/src/app/services/social/social.service.ts +++ b/src/app/services/social/social.service.ts @@ -7,7 +7,10 @@ import {DatasharingService} from 'src/app/services/datasharing.service'; const graphqlCreateGroupQuery = `mutation($name: String!) { createGroup(name: $name) { - id + id, + name, + picture, + deletable } }`; @@ -39,7 +42,10 @@ export class SocialService extends BaseService { */ createGroup(name: string) { const body = SocialService.buildGroupCreateBody(name); - return this.postGraphql(body, null, 0); + return this.postGraphql(body, null, 0) + .pipe(tap(response => { + this.data.addGroupToUser(response.data.createGroup); + })); } public removeFriend(id: number) {