Ignore:
Timestamp:
08/22/26 19:00:38 (10 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

Location:
petify-frontend/src/api
Files:
2 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)}`)
  • petify-frontend/src/api/reviews.ts

    rae83647 rf6ed6e4  
    2020}
    2121
     22export type UserReviewInteractionType =
     23  | 'EVENT'
     24  | 'PERSONAL_INTERACTION'
     25  | 'ONLINE'
     26  | 'PHONE_CALL'
     27  | 'OTHER'
     28
    2229export async function createReview(
    2330  targetUserId: number,
    2431  userId: number,
    2532  rating: number,
    26   comment: string
     33  comment: string,
     34  interactionType: UserReviewInteractionType
    2735): Promise<Review> {
    2836  const url = joinUrl(getBaseUrl(), `/api/reviews/${targetUserId}`)
     
    3644      rating,
    3745      comment,
     46      interactionType,
    3847    }),
    3948  })
Note: See TracChangeset for help on using the changeset viewer.