import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { environment } from 'src/environments/environment';
import { Useremailmapping } from './useremailmapping';
let header = new HttpHeaders();
header = header.set('Content-Type', 'application/json; charset=utf-8');
@Injectable({
  providedIn: 'root'
})
@Injectable({
  providedIn: 'root'
})
export class UseremailmappingService {
  baseUrl: string = environment.serviceUrl;
  constructor(private httpClient: HttpClient) { }
  Post(role: Useremailmapping): Observable<any> {
    return this.httpClient.post<any>(this.baseUrl + 'api/UserMailMappingApi/Add', role, { headers: header, observe: 'response' });
  }
  Put(role: Useremailmapping): Observable<any> {
    return this.httpClient.post<any>(this.baseUrl + 'api/UserMailMappingApi/Update', role, { headers: header, observe: 'response' });
  }
  getMappedUserList(roleid: any): Observable<any> {
    return this.httpClient.get<any>(this.baseUrl + 'api/UserMailMappingApi/GetById/' +
    roleid, { headers: header, observe: 'response' });
  }
}
