Skip to content

Commit

Permalink
After review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Temmmmmo committed Oct 8, 2023
1 parent 523c34a commit c2793b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
20 changes: 8 additions & 12 deletions src/utils/UserdataConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,16 @@ export class UserdataConverter {
if (!acc.has(item.category)) {
acc.set(item.category, new Map());
}
const extendedValue: UserdataExtendedValue = {
name: '',
is_required: false,
changeable: true,
type: UserdataParamResponseType.All,
};
let extendedValue: UserdataExtendedValue | undefined = undefined;
if (typeof item.value === 'string') {
extendedValue.name = item.value;
extendedValue = {
name: item.value,
is_required: false,
changeable: true,
type: UserdataParamResponseType.All,
};
} else {
extendedValue.name = item.value.name;
extendedValue.is_required = item.value.is_required;
extendedValue.changeable = item.value.changeable;
extendedValue.type = item.value.type;
extendedValue = item.value;
}
acc.get(item.category)!.set(item.param, extendedValue);
return acc;
Expand Down Expand Up @@ -204,7 +201,6 @@ export class UserdataConverter {
value: item.value,
} as UserdataUpdateUserItem;
updateUserdata.items.push(updateItem);
console.log('MEM');
}
}
return updateUserdata;
Expand Down
11 changes: 1 addition & 10 deletions src/views/profile/ProfileEditView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import { UserdataArray, UserdataCategoryName, UserdataParams } from '@/models';
import router from '@/router';
import { UserdataExtendedValue } from '@/api/models';
// import router from '@/router';
const profileStore = useProfileStore();
const fullName_item = ref<UserdataExtendedValue | null>();
const photoURL_item = ref<UserdataExtendedValue | null>();
Expand All @@ -34,7 +32,6 @@ onMounted(async () => {
]);
const { data: user } = await UserdataApi.getUser(me.id);
const { data } = await UserdataApi.getCategories();
console.log(data);
fullName_item.value = UserdataConverter.getItem(user, {
category: UserdataCategoryName.PersonalInfo,
param: UserdataParams.FullName,
Expand Down Expand Up @@ -63,7 +60,7 @@ async function saveEdit() {
value: fullName.value,
},
]);
UserdataApi.patchUserById(me.id, updateBody);
await UserdataApi.patchUserById(me.id, updateBody);
router.push('/profile');
}
</script>
Expand Down Expand Up @@ -155,12 +152,6 @@ async function saveEdit() {
z-index: 2;
}
.buttons {
display: flex;
flex-wrap: wrap;
gap: 16px;
}
.section {
margin-bottom: 40px;
Expand Down

0 comments on commit c2793b6

Please sign in to comment.