Commit 4e23304f authored by TTS Kieu Tuan Anh's avatar TTS Kieu Tuan Anh

fix string image

parent b7aa4a55
...@@ -48,8 +48,7 @@ export default { ...@@ -48,8 +48,7 @@ export default {
// https://go.nuxtjs.dev/axios // https://go.nuxtjs.dev/axios
'@nuxtjs/axios', '@nuxtjs/axios',
'@nuxtjs/auth-next', '@nuxtjs/auth-next',
'@nuxtjs/toast', '@nuxtjs/toast'
'@pinia/nuxt'
], ],
// Axios module configuration: https://go.nuxtjs.dev/config-axios // Axios module configuration: https://go.nuxtjs.dev/config-axios
......
...@@ -612,7 +612,7 @@ export default { ...@@ -612,7 +612,7 @@ export default {
} }
}) })
.then((response) => { .then((response) => {
self.$toast.success('User updated successfully!', { self.$toast.success('Category updated successfully!', {
duration: 3000 duration: 3000
}) })
this.editedItem = response.data.data this.editedItem = response.data.data
......
...@@ -106,12 +106,11 @@ ...@@ -106,12 +106,11 @@
</v-col> </v-col>
<v-col cols="12" text-align=" left"> <v-col cols="12" text-align=" left">
<v-img <v-img
v-for="(imageEdit, index) in eImages" v-if="typeof eImages === 'string'"
:key="index"
contain contain
height="100px" height="100px"
width="150px" width="150px"
:src="imageEdit" :src="eImages"
/> />
</v-col> </v-col>
</v-row> </v-row>
...@@ -630,7 +629,7 @@ export default { ...@@ -630,7 +629,7 @@ export default {
}) })
.catch((error) => { .catch((error) => {
console.log(error) console.log(error)
self.$toast.error('something went wrong while trying create!', { self.$toast.error('something went wrong while trying update!', {
duration: 3000 duration: 3000
}) })
}) })
......
...@@ -761,6 +761,7 @@ export default { ...@@ -761,6 +761,7 @@ export default {
this.eImages = item.images this.eImages = item.images
this.editedIndex = this.products.indexOf(item) this.editedIndex = this.products.indexOf(item)
console.log(item.variants) console.log(item.variants)
console.log(typeof this.eImages)
this.dialog3 = true this.dialog3 = true
}, },
updateProduct (ID) { updateProduct (ID) {
...@@ -784,7 +785,6 @@ export default { ...@@ -784,7 +785,6 @@ export default {
} }
} }
const currentPostIndex = this.editedIndex const currentPostIndex = this.editedIndex
try {
this.$axios this.$axios
.post(`/products/update/${this?.eId}`, .post(`/products/update/${this?.eId}`,
fd, { fd, {
...@@ -801,9 +801,12 @@ export default { ...@@ -801,9 +801,12 @@ export default {
this.editedItem = response.data.data this.editedItem = response.data.data
Object.assign(this.products[currentPostIndex], this.editedItem) Object.assign(this.products[currentPostIndex], this.editedItem)
}) })
} catch (error) { .catch((error) => {
console.log(error) console.log(error)
} self.$toast.error('something went wrong while trying update!', {
duration: 3000
})
})
}, },
addMore () { addMore () {
this.variants.push({ this.variants.push({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment