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:
@@ -88,6 +88,8 @@ function SendReq({
|
||||
if (profile?.uuid) {
|
||||
const userInfo = { ...profile, username: profile.mobile_number };
|
||||
Cookies.set("userInfo", JSON.stringify(userInfo), cookieOptions);
|
||||
// overwrite the OTP uuid set in handleSetCookie with the real user uuid
|
||||
Cookies.set("uuid", profile.uuid, cookieOptions);
|
||||
|
||||
// اگر در صفحه appointment هستیم، به مرحله 3 (Detail) میرویم
|
||||
if (setStep) {
|
||||
|
||||
Reference in New Issue
Block a user