diff --git a/src/utils/UserdataConverter.ts b/src/utils/UserdataConverter.ts index 6eee112f..ce19eda9 100644 --- a/src/utils/UserdataConverter.ts +++ b/src/utils/UserdataConverter.ts @@ -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; @@ -204,7 +201,6 @@ export class UserdataConverter { value: item.value, } as UserdataUpdateUserItem; updateUserdata.items.push(updateItem); - console.log('MEM'); } } return updateUserdata; diff --git a/src/views/profile/ProfileEditView.vue b/src/views/profile/ProfileEditView.vue index 85f866d1..4f7705c7 100644 --- a/src/views/profile/ProfileEditView.vue +++ b/src/views/profile/ProfileEditView.vue @@ -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(); const photoURL_item = ref(); @@ -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, @@ -63,7 +60,7 @@ async function saveEdit() { value: fullName.value, }, ]); - UserdataApi.patchUserById(me.id, updateBody); + await UserdataApi.patchUserById(me.id, updateBody); router.push('/profile'); } @@ -155,12 +152,6 @@ async function saveEdit() { z-index: 2; } -.buttons { - display: flex; - flex-wrap: wrap; - gap: 16px; -} - .section { margin-bottom: 40px;