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

@Injectable({
  providedIn: 'root'
})
export class Miptopic3Service {
  baseUrl: string = environment.serviceUrl;

  constructor(private httpClient: HttpClient) {
  }

  Get(): Observable<any> {
    return this.httpClient.get<any>(this.baseUrl + 'api/Miptopic3Api')
  }
  GetActive(): Observable<any> {
    return this.httpClient.get<any>(this.baseUrl + 'api/Miptopic3Api/GetActiveMiptopic3')
  }
  Post(miptopic3: Miptopic3): Observable<any> {

    let header = new HttpHeaders();
    header = header.set('Content-Type', 'application/json; charset=utf-8');
    return this.httpClient.post(this.baseUrl + 'api/Miptopic3Api/add', miptopic3, { headers: header, observe: 'response' })
  }
  Delete(miptopic3: Miptopic3) {
    let header = new HttpHeaders();
    header = header.set('Content-Type', 'application/json; charset=utf-8');
    return this.httpClient.post(this.baseUrl + 'api/Miptopic3Api/activeordeactive', miptopic3, { headers: header, observe: 'response' })
  }
  Put(miptopic3: Miptopic3): Observable<any> {
    let header = new HttpHeaders();
    header = header.set('Content-Type', 'application/json; charset=utf-8');
    return this.httpClient.post(this.baseUrl + 'api/Miptopic3Api/Update', miptopic3, { headers: header, observe: 'response' })
  }
  GetByMappedUser(): Observable<any> {
    return this.httpClient.get<any>(this.baseUrl + 'api/Miptopic3Api/GetByMappedUser')
  }

}
