fix(dashboard): wire turns/transactions to real endpoints + fix uuid cookie

- Login now overwrites the uuid cookie with the real user uuid (was the
  OTP uuid), so server-side profile/dashboard fetches resolve.
- getMyAppointments → /api/v1/appointments/user (patient's own bookings;
  /my/appointments is role-scoped and empty for plain users), read from
  the double-nested data.data.
- getMyPayments → /api/v1/my/payments (new endpoint), read paginated
  data + meta.totalPages.
- Drop the userId path param (both endpoints derive the user from token).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
hamed
2026-06-15 19:27:18 +03:30
co-authored by Claude Opus 4.8
parent cec6b51f23
commit 0a95e99efa
4 changed files with 15 additions and 30 deletions
+2 -2
View File
@@ -70,12 +70,12 @@ export const request = {
...removeTokenHead,
}),
postAppointment: (data) => api.post(`api/v1/appointment`, data, { requireAuth: true }),
getMyAppointments: (userId, params) => api.get(`api/v1/appointment/my-appointments/${userId}`, { params, requireAuth: true }),
getMyAppointments: (params) => api.get(`api/v1/appointments/user`, { params, requireAuth: true }),
postAppointmentPayment: (data) =>
api.post(`api/v1/payment/appointment`, data, { requireAuth: true }),
getPaymentConfig: () => api.get(`api/v1/payment/config`, { requireAuth: true }),
getPayment: (uuid) => api.get(`api/v1/payment/${uuid}`, { requireAuth: true }),
getMyPayments: (userId, params) => api.get(`api/v1/payment/my-payments/${userId}`, { params, requireAuth: true }),
getMyPayments: (params) => api.get(`api/v1/my/payments`, { params, requireAuth: true }),
postDoctor: (data) => api.post("api/v1/doctor", data),
postImageUpload: (data) =>
api.post("file/upload/clinic_pro/doctor/field_image", data, {