import { Injectable } from '@angular/core';
import { environment } from 'src/environments/environment';
import { Observable } from 'rxjs';
import { HttpHeaders, HttpClient } from '@angular/common/http';
import { Projectdefinitionmaster } from './projectdefinitionmaster';

@Injectable({
    providedIn: 'root'
})
export class ProjectdefinitionmasterService {

    baseUrl: string = environment.serviceUrl;

    constructor(private httpClient: HttpClient) {
    }

    Get(): Observable<any> {
        return this.httpClient.get<any>(this.baseUrl + 'api/UnitApi');
    }
    GetActive(): Observable<any> {
        return this.httpClient.get<any>(this.baseUrl + 'api/UnitApi/GetActiveUnit');
    }
    Delete(projectdefinitionmaster: Projectdefinitionmaster) {
        return this.httpClient.post(this.baseUrl + 'api/ProjectConfigurationApi/activeordeactive',
            projectdefinitionmaster, { observe: 'response' });
    }
    getAllByUserId(data: any): Observable<any> {
        return this.httpClient.post<any>(this.baseUrl + 'api/ProjectConfigurationApi/GetAllByUserId',
            data, { observe: 'response' });
    }
    getAllWOWFByUserId(data: any): Observable<any> {
        return this.httpClient.post<any>(this.baseUrl + 'api/ProjectConfigurationApi/getAllWOWFByUserId',
            data, { observe: 'response' });
    }
    GetAllForSupplement(data: any): Observable<any> {
        return this.httpClient.post<any>(this.baseUrl + 'api/ProjectConfigurationApi/GetAllForSupplement',
            data, { observe: 'response' });
    }
}
