Ignore:
Timestamp:
08/22/26 19:00:38 (8 hours ago)
Author:
veronika-ils <ilioskaveronika@…>
Branches:
master
Parents:
ae83647
Message:

feat: The app is consistent with the changes made in phase 1 and phase 2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • petify-frontend/src/api/profile.ts

    rae83647 rf6ed6e4  
    3535  city: string
    3636  address: string
     37  workDays?: string
     38  startTime?: string
     39  endTime?: string
     40  scheduleComplete?: boolean
    3741}
    3842
     
    464468}
    465469
     470export async function updateMyClinicSchedule(
     471  userId: number,
     472  data: {
     473    workDays: string
     474    startTime: string
     475    endTime: string
     476  }
     477): Promise<VetClinic> {
     478  const url = joinUrl(getBaseUrl(), `/api/clinics/my/schedule`)
     479  const response = await fetch(url, {
     480    method: 'PUT',
     481    headers: {
     482      'Content-Type': 'application/json',
     483      'X-User-Id': String(userId),
     484    },
     485    body: JSON.stringify(data),
     486  })
     487
     488  if (!response.ok) {
     489    const error = await response.json()
     490    throw new Error(error.error || `Failed to update clinic schedule: ${response.statusText}`)
     491  }
     492
     493  return await response.json()
     494}
     495
    466496export async function getClinicAvailableSlots(clinicId: number, date: string): Promise<AppointmentSlot[]> {
    467497  const url = joinUrl(getBaseUrl(), `/api/appointments/clinics/${clinicId}/available-slots?date=${encodeURIComponent(date)}`)
Note: See TracChangeset for help on using the changeset viewer.