fix(api): ensure token is refreshed if not available during request
This commit is contained in:
@@ -38,12 +38,7 @@ function Turns({ user, setIsTurnsDetails, loading }) {
|
||||
const items = response?.data?.data;
|
||||
|
||||
if (Array.isArray(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);
|
||||
setAppointments(items);
|
||||
} else {
|
||||
setAppointments([]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user