import { Injectable } from '@angular/core';
import { environment } from '../../../environments/environment';

import { Observable } from 'rxjs';
import { HttpHeaders, HttpClient } from '@angular/common/http';
import { UserMailFolderMapping } from './usermailfoldermapping';
import { Console } from 'console';

let header = new HttpHeaders();
header = header.set('Content-Type', 'application/json; charset=utf-8');

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

  baseUrl: string = environment.serviceUrl;
  constructor(private httpClient: HttpClient) { }

  Get_allusermailmapping(): Observable<any> {
    return this.httpClient.get<any>(this.baseUrl + 'api/UserApi/Get_allusermailmapping', {  observe: 'response' });
  }

  Add_mailfoldername(data: any[]): Observable<any>{
    //debugger;
    //console.log(mailfoldername);
    return this.httpClient.post<any>(this.baseUrl + 'api/UserApi/Add_mailfoldername', data, { observe: 'response' })
  }
  Add_usermailfolder(data:any[]): Observable<any>{
    debugger;
    return this.httpClient.post<any>(this.baseUrl + 'api/UserApi/Add_usermailfoldername',data,{observe: 'response'})
  }
  

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

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

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