import { RestService, Rest } from '@abp/ng.core';
import { Injectable } from '@angular/core';
import type { CreateDepartmentDto, DepartmentDto } from '../dtos/models';

@Injectable({
  providedIn: 'root',
})
export class DepartmentService {
  apiName = 'Default';
  

  create = (input: CreateDepartmentDto, config?: Partial<Rest.Config>) =>
    this.restService.request<any, DepartmentDto>({
      method: 'POST',
      url: '/api/app/department',
      body: input,
    },
    { apiName: this.apiName,...config });
  

  get = (config?: Partial<Rest.Config>) =>
    this.restService.request<any, DepartmentDto[]>({
      method: 'GET',
      url: '/api/app/department',
    },
    { apiName: this.apiName,...config });

  constructor(private restService: RestService) {}
}
