Added service components
[portal.git] / portal-FE-common / src / app / shared / services / portal-admins / portal-admin.service.ts
1 import { Injectable } from '@angular/core';
2 import { HttpClient } from '@angular/common/http';
3 import { environment } from 'src/environments/environment';
4
5 @Injectable({
6   providedIn: 'root'
7 })
8 export class PortalAdminsService {
9   apiUrl = environment.api;
10   constructor(private http: HttpClient) { }
11
12   getPortalAdmins() {
13     return this.http.get(this.apiUrl.portalAdmins);
14   }
15
16   addPortalAdmin(selectedUser: string) {
17     return this.http.post(this.apiUrl.portalAdmin, selectedUser);
18   }
19
20   removePortalAdmin(userId: number, orUserId: string) {
21     let userInfo = userId + "-" + orUserId;
22     return this.http.delete(this.apiUrl.portalAdmin + '/' + userInfo);
23   }
24
25 }