fix: profile save after image removal

This commit is contained in:
Rehan Ansari
2025-12-22 23:26:41 +05:30
parent 69d0efbfa7
commit 3d9850dc73
@@ -35,16 +35,16 @@
<div v-else class="mb-4"> <div v-else class="mb-4">
<div class="flex items-center"> <div class="flex items-center">
<img <img
:src="profile.image.file_url" :src="profile.image?.file_url"
class="object-cover h-[50px] w-[50px] rounded-full border-4 border-white object-cover" class="object-cover h-[50px] w-[50px] rounded-full border-4 border-white object-cover"
/> />
<div class="text-base flex flex-col ml-2"> <div class="text-base flex flex-col ml-2">
<span> <span>
{{ profile.image.file_name }} {{ profile.image?.file_name }}
</span> </span>
<span class="text-sm text-ink-gray-4 mt-1"> <span class="text-sm text-ink-gray-4 mt-1">
{{ getFileSize(profile.image.file_size) }} {{ getFileSize(profile.image?.file_size) }}
</span> </span>
</div> </div>
<X <X
@@ -177,7 +177,7 @@ const updateProfile = createResource({
doctype: 'User', doctype: 'User',
name: props.profile.data.name, name: props.profile.data.name,
fieldname: { fieldname: {
user_image: profile.image.file_url, user_image: profile.image?.file_url || null,
...profile, ...profile,
}, },
} }