Files
nobat724_front/lib/representationAdapters.js
T
hamed f87110c277 refactor: remove unused components and files related to date filtering and doctor search
- Deleted Date.js and FilterDate.js components as they are no longer needed.
- Removed SearchDoctor.js component which was responsible for searching doctors.
- Cleaned up the Head component by removing references to the deleted Date and SearchDoctor components.
- Removed TurnsPage component and its associated List component, which were not utilized.
- Deleted Cards and Table components from the list directory as they were not in use.
- Removed user account related components including Tab, Head, and Form components.
- Cleaned up bank account components including List, Item, and modal components.
- Removed representation adapters and related functions that were not in use.
2026-06-25 18:14:27 +03:30

31 lines
1.1 KiB
JavaScript

export function buildPatientUser(profile, extras = {}) {
// GET /user-profile is double-nested: { data: { data: {...} } } (after fetchReq → response.data)
const data = profile?.data?.data ?? profile?.data ?? profile ?? {};
return {
profile: data.avatar ?? extras.avatar ?? "/assets/images/profile-user.png",
name:
[data.label ?? data.name, data.family].filter(Boolean).join(" ").trim() ||
extras.realName ||
"",
phone: data.phone ?? data.mobile ?? extras.mobile ?? "",
total_transactions: extras.total_transactions ?? 0,
number_of_turns: extras.number_of_turns ?? 0,
national_code: data.national_code ?? "",
gender: data.gender ?? "",
date_of_birth: data.birthday ?? "",
father_name: data.fathers_name ?? "",
insurance: data.basic_insurance ?? "",
insurance_number: "",
blood_group: data.blood_type ?? "",
marital_status: data.marital_status ?? "",
home_phone: data.home_phone ?? "",
education: data.education ?? "",
job: data.job ?? "",
work_phone: data.work_phone ?? "",
turns: { current: [], done: [] },
comments: [],
messages: [],
};
}