46 lines
1.4 KiB
TypeScript

import { RestService, Rest } from '@abp/ng.core';
import { Injectable } from '@angular/core';
import type { CreateUpdateShiftManagementDto, ShiftManagementDto } from '../doctors/dto/models';
@Injectable({
providedIn: 'root',
})
export class ShiftManagementService {
apiName = 'Default';
createOrUpdateShift = (input: CreateUpdateShiftManagementDto, config?: Partial<Rest.Config>) =>
this.restService.request<any, ShiftManagementDto>({
method: 'POST',
url: '/api/app/shift-management/or-update-shift',
body: input,
},
{ apiName: this.apiName,...config });
deleteShift = (id: string, config?: Partial<Rest.Config>) =>
this.restService.request<any, void>({
method: 'DELETE',
url: `/api/app/shift-management/${id}/shift`,
},
{ apiName: this.apiName,...config });
getAllShifts = (config?: Partial<Rest.Config>) =>
this.restService.request<any, ShiftManagementDto[]>({
method: 'GET',
url: '/api/app/shift-management/shifts',
},
{ apiName: this.apiName,...config });
getShiftsByDoctorId = (doctorId: string, config?: Partial<Rest.Config>) =>
this.restService.request<any, ShiftManagementDto>({
method: 'GET',
url: `/api/app/shift-management/shifts-by-doctor-id/${doctorId}`,
},
{ apiName: this.apiName,...config });
constructor(private restService: RestService) {}
}