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

@Injectable({ providedIn: 'root' })
export class HrSettingsService {
  private http = inject(HttpClient);
  private apiUrl = `${environment.apiUrl}/hr/settings`;

  getAll(): Observable<any> {
    return this.http.get(this.apiUrl);
  }

  update(settings: Record<string, any>): Observable<any> {
    return this.http.put(this.apiUrl, settings);
  }
}
