Changeset f6ed6e4 for petify-frontend/src/api
- Timestamp:
- 08/22/26 19:00:38 (10 hours ago)
- Branches:
- master
- Parents:
- ae83647
- Location:
- petify-frontend/src/api
- Files:
-
- 2 edited
-
profile.ts (modified) (2 diffs)
-
reviews.ts (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
petify-frontend/src/api/profile.ts
rae83647 rf6ed6e4 35 35 city: string 36 36 address: string 37 workDays?: string 38 startTime?: string 39 endTime?: string 40 scheduleComplete?: boolean 37 41 } 38 42 … … 464 468 } 465 469 470 export 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 466 496 export async function getClinicAvailableSlots(clinicId: number, date: string): Promise<AppointmentSlot[]> { 467 497 const url = joinUrl(getBaseUrl(), `/api/appointments/clinics/${clinicId}/available-slots?date=${encodeURIComponent(date)}`) -
petify-frontend/src/api/reviews.ts
rae83647 rf6ed6e4 20 20 } 21 21 22 export type UserReviewInteractionType = 23 | 'EVENT' 24 | 'PERSONAL_INTERACTION' 25 | 'ONLINE' 26 | 'PHONE_CALL' 27 | 'OTHER' 28 22 29 export async function createReview( 23 30 targetUserId: number, 24 31 userId: number, 25 32 rating: number, 26 comment: string 33 comment: string, 34 interactionType: UserReviewInteractionType 27 35 ): Promise<Review> { 28 36 const url = joinUrl(getBaseUrl(), `/api/reviews/${targetUserId}`) … … 36 44 rating, 37 45 comment, 46 interactionType, 38 47 }), 39 48 })
Note:
See TracChangeset
for help on using the changeset viewer.
