loading ,page

This commit is contained in:
Arezoo
2025-10-27 10:58:26 +03:30
parent 8ab33b4e93
commit 79ff139779
9 changed files with 136 additions and 140 deletions
+10 -3
View File
@@ -16,12 +16,19 @@ export async function getClinicDoctors(slug, params = {}) {
}
const json = await response.json();
return {
// ✅ خروجی همیشه ساختار ثابت دارد
return {
data: json?.data || [],
page: json?.page || json?.pages || { total_pages: 1, current: 1 },
};
} catch (error) {
console.error("خطا در دریافت دکترهای کلینیک:", error);
return [];
console.error("خطا در دریافت دکترهای کلینیک:", error);
// ✅ ساختار خروجی در حالت خطا هم مثل حالت عادی
return {
data: [],
page: { total_pages: 1, current: 1 },
};
}
}