fixed uploaded attachment not removed

This commit is contained in:
Asif Takavala
2022-02-15 06:10:04 +00:00
committed by Mohit Panjwani
parent f34dac9d3f
commit 8ba84f68c7
9 changed files with 59 additions and 20 deletions

View File

@ -153,6 +153,7 @@ let isSaving = ref(false)
let avatarFileBlob = ref(null)
let isShowPassword = ref(false)
let isShowConfirmPassword = ref(false)
const isCustomerAvatarRemoved = ref(false)
if (userStore.userForm.avatar) {
imgFiles.value.push({
@ -206,6 +207,7 @@ function onFileInputChange(fileName, file) {
function onFileInputRemove() {
avatarFileBlob.value = null
isCustomerAvatarRemoved.value = true
}
function updateCustomerData() {
@ -230,6 +232,7 @@ function updateCustomerData() {
if (avatarFileBlob.value) {
data.append('customer_avatar', avatarFileBlob.value)
}
data.append('is_customer_avatar_removed', isCustomerAvatarRemoved.value)
userStore
.updateCurrentUser({
@ -243,6 +246,8 @@ function updateCustomerData() {
state.userForm.password = ''
state.userForm.confirm_password = ''
})
avatarFileBlob.value = null
isCustomerAvatarRemoved.value = false
}
})
.catch((error) => {