fix(dashboard): show name from profile label field
The backend stores the first name in the profile's label field, but the account form binds the نام input to information.name, so a saved name never displayed on reload. Map label→name when loading the profile (and drop the raw label) so the field populates; saving still sends name, which the backend hydrates back into label. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -35,6 +35,9 @@ function Information({ information, setInformation }) {
|
||||
|
||||
if (hasProfileData) {
|
||||
let changedData = { ...profile };
|
||||
// backend stores the first name in `label`; the form binds to `name`
|
||||
changedData.name = profile?.label ?? "";
|
||||
delete changedData.label;
|
||||
changedData.basic_insurance = profile?.basic_insurance_id ? [profile.basic_insurance_id] : [];
|
||||
changedData.supplementary_insurance = profile?.supplementary_insurance_id ? [profile.supplementary_insurance_id] : [];
|
||||
changedData.other = profile?.other ?? {
|
||||
|
||||
Reference in New Issue
Block a user