feature: users with treatment edit permission should now have working hours defined. the appointment grid is now being drawn based on the doctor's working hours.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { apiClient } from './client';
|
||||
import type { AppointmentColumnProvider, AppointmentRecord } from '@/types/appointment';
|
||||
import { toDateInputValue } from '@/components/appointments/appointmentTime';
|
||||
|
||||
export interface CreateAppointmentBody {
|
||||
patientId: string;
|
||||
@@ -12,8 +13,11 @@ export interface CreateAppointmentBody {
|
||||
export type UpdateAppointmentBody = Partial<CreateAppointmentBody>;
|
||||
|
||||
export const appointmentsApi = {
|
||||
columnProviders: async (): Promise<{ success: boolean; data: AppointmentColumnProvider[] }> => {
|
||||
const response = await apiClient.get('/appointments/column-providers');
|
||||
columnProviders: async (
|
||||
scheduleDate?: Date,
|
||||
): Promise<{ success: boolean; data: AppointmentColumnProvider[] }> => {
|
||||
const params = scheduleDate ? { date: toDateInputValue(scheduleDate) } : undefined;
|
||||
const response = await apiClient.get('/appointments/column-providers', { params });
|
||||
return response.data;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user