Fix group bug

master
Max 5 years ago
parent 455ac31c61
commit ab722322e6

@ -1,9 +1,9 @@
import {Injectable} from '@angular/core';
import {environment} from 'src/environments/environment';
import {HttpClient} from '@angular/common/http';
import {BaseService} from '../base.service';
import { Injectable } from '@angular/core';
import { environment } from 'src/environments/environment';
import { HttpClient } from '@angular/common/http';
import { BaseService } from '../base.service';
import { tap } from 'rxjs/internal/operators/tap';
import {DatasharingService} from 'src/app/services/datasharing.service';
import { DatasharingService } from 'src/app/services/datasharing.service';
import { Group } from 'src/app/models/group';
import { GroupInfo } from 'src/app/models/groupinfo';
@ -46,10 +46,12 @@ export class SocialService extends BaseService {
const body = SocialService.buildGroupCreateBody(name);
return this.postGraphql(body, null, 0)
.pipe(tap(response => {
let group = new Group();
group = response.data.createGroup;
group.picture = group.buildPictureUrl(group.picture);
this.data.addGroupToUser(group);
const group = response.data.createGroup;
this.data.addGroupToUser(new GroupInfo(
group.id,
group.name,
group.picture,
group.deletable));
}));
}

Loading…
Cancel
Save