import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';

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

  baseUrl: string = environment.serviceUrl;

  constructor(private httpClient: HttpClient) { }

  Get_all(): Observable<any> {
    return this.httpClient.get<any>(this.baseUrl + 'api/CategoryApi/Getall', {  observe: 'response' });
  }
  Edit_category(data:any[]):Observable<any>{
    return this.httpClient.post<any>(this.baseUrl + 'api/CategoryApi/Edit_category', data,  { observe: 'response' });
  } 
  Active_category(data:any[]):Observable<any>{
    return this.httpClient.post<any>(this.baseUrl + 'api/CategoryApi/Active_category', data,  { observe: 'response' });
  }

  Add_category(data:any[]):Observable<any>{
    return this.httpClient.post<any>(this.baseUrl + 'api/CategoryApi/Add_category', data,  { observe: 'response' });
  }
}
