import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { environment } from 'src/environments/environment';
let header = new HttpHeaders();
header = header.set('Content-Type', 'application/json; charset=utf-8');
@Injectable({
  providedIn: 'root'
})
export class UserrolemappingService {
  baseUrl: string = environment.serviceUrl;
  constructor(private httpClient: HttpClient) { }

  getMappedUserList(roleid: any): Observable<any> {
    return this.httpClient.get<any>(this.baseUrl + 'api/UserRoleMappingApi/GetById/' +
    roleid, { headers: header, observe: 'response' });
  }
  Post(userrolemapping: any[]): Observable<any> {
    return this.httpClient.post<any>(this.baseUrl + 'api/UserRoleMappingApi/add',
    userrolemapping, { headers: header, observe: 'response' });
  }
  UpdateUserRoleOnEmpty(userrolemapping: any): Observable<any> {
    return this.httpClient.post<any>(this.baseUrl + 'api/UserRoleMappingApi/UpdateUserRoleOnEmpty',
    userrolemapping, { headers: header, observe: 'response' });
  }
}
