mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 12:11:08 -04:00
fixed uploaded attachment not removed
This commit is contained in:
committed by
Mohit Panjwani
parent
f34dac9d3f
commit
8ba84f68c7
@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user