import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { Userprojectmapping } from './userprojectmapping';
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 UserprojectmappingService {
  baseUrl: string = environment.serviceUrl;
  constructor(private httpClient: HttpClient) {
  }
  Post(userprojectmapping: any[]): Observable<any> {
    return this.httpClient.post<any>(this.baseUrl + 'api/UserProjectMappingApi/add',
      userprojectmapping, { headers: header, observe: 'response' });
  }

  getMappedUserList(project_definitionid: any): Observable<any> {
    return this.httpClient.get<any>(this.baseUrl + 'api/UserProjectMappingApi/GetById/' +
      project_definitionid, { headers: header, observe: 'response' });
  }
  UpdateUserProjectOnEmpty(userprojectmapping: any): Observable<any> {
    return this.httpClient.post<any>(this.baseUrl + 'api/UserProjectMappingApi/UpdateUserProjectOnEmpty',
      userprojectmapping, { headers: header, observe: 'response' });
  }

}
