feat(userAccount): enhance user profile handling with avatar upload and additional user data
This commit is contained in:
@@ -38,11 +38,16 @@ function Turns({ user, setIsTurnsDetails, loading }) {
|
||||
const items = response?.data?.data;
|
||||
|
||||
if (Array.isArray(items)) {
|
||||
setAppointments(items);
|
||||
// API برمیگرداند doctor_name/doctor_uuid (تخت)؛ کامپوننتها doctor.name (تودرتو) میخواهند.
|
||||
const normalized = items.map((a) => ({
|
||||
...a,
|
||||
doctor: { uuid: a.doctor_uuid, name: a.doctor_name, specialties: [] },
|
||||
}));
|
||||
setAppointments(normalized);
|
||||
} else {
|
||||
setAppointments([]);
|
||||
}
|
||||
setTotalPages(1);
|
||||
setTotalPages(response?.meta?.totalPages || 1);
|
||||
} catch (error) {
|
||||
console.error("Error fetching appointments:", error);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user