import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs';
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 AuthordashboardService {
  baseUrl: string = environment.serviceUrl;
  constructor(private httpClient: HttpClient) { }

  getAuthorDashboardData(data: any): Observable<any> {
    return this.httpClient.post<any>(this.baseUrl + 'api/AuthorDashboardApi/getAuthorDashboardData',
        data, { headers: header, observe: 'response' });
}

getAuthorDashboardrowcount(data: any): Observable<any> {
  return this.httpClient.post<any>(this.baseUrl + 'api/AuthorDashboardApi/getAuthorDashboardrowcount',
      data, { headers: header, observe: 'response' });
}
GetRoleByUserId(id: any): Observable<any> {
  const headers = new HttpHeaders()
    .set('Content-Type', 'application/json; charset=utf-8')
    //.set('Authorization', 'Bearer ' + token);
  return this.httpClient.get<any>(this.baseUrl + 'api/UserApi/GetUsersRights/'+id, { headers: headers, observe: 'response' });
}

}
