import { Injectable } from '@angular/core' ; import { Observable } from 'rxjs' ; import { ApiService } from './api.service' ; import { User } from '@eda/models/user-models/user.model' ; export interface IGroup { name : string ; role : { label : string ; value : string ; } ; img : File ; users : User [ ] ; } @ Injectable ( ) export class GroupService extends ApiService { private route = '/admin/groups' ; getGroups ( ) { return this . get ( this . route ) ; } getGroupsByUser ( ) { return this . get ( `${ this . route }/mine` ) ; } getGroup ( id ) { return this . get ( `${ this . route }/${ id }` ) ; } insertGroup ( body ) { return this . post ( this . route , body ) ; } updateGroup ( id , body ) { return this . put ( `${ this . route }/${ id }` , body ) ; } deleteGroup ( id ) { return this . delete ( `${ this . route }/${ id }` ) ; } }