Commit ffcb4ea2 authored by TTS Kieu Tuan Anh's avatar TTS Kieu Tuan Anh
parents 46c4a8f8 d1b0d336
......@@ -612,7 +612,7 @@ export default {
}
})
.then((response) => {
self.$toast.success('User updated successfully!', {
self.$toast.success('Category updated successfully!', {
duration: 3000
})
this.editedItem = response.data.data
......
......@@ -106,12 +106,11 @@
</v-col>
<v-col cols="12" text-align=" left">
<v-img
v-for="(imageEdit, index) in eImages"
:key="index"
v-if="typeof eImages === 'string'"
contain
height="100px"
width="150px"
:src="imageEdit"
:src="eImages"
/>
</v-col>
</v-row>
......@@ -213,7 +212,6 @@
v-model="category_id"
:items="categories"
:search="search"
:filter="filter"
item-text="name"
item-value="id"
label="Category"
......@@ -630,7 +628,7 @@ export default {
})
.catch((error) => {
console.log(error)
self.$toast.error('something went wrong while trying create!', {
self.$toast.error('something went wrong while trying update!', {
duration: 3000
})
})
......@@ -668,7 +666,7 @@ export default {
padding-left: 90px !important;
}
img {
width: 100%;
height: 100%;
}
width: 100px;
height: 150px;
}
</style>
......@@ -761,6 +761,7 @@ export default {
this.eImages = item.images
this.editedIndex = this.products.indexOf(item)
console.log(item.variants)
console.log(typeof this.eImages)
this.dialog3 = true
},
updateProduct (ID) {
......@@ -784,26 +785,28 @@ export default {
}
}
const currentPostIndex = this.editedIndex
try {
this.$axios
.post(`/products/update/${this?.eId}`,
fd, {
headers: {
Authorization: `Bearer ${this.$auth.$storage.getUniversal('token')}`
}
this.$axios
.post(`/products/update/${this?.eId}`,
fd, {
headers: {
Authorization: `Bearer ${this.$auth.$storage.getUniversal('token')}`
}
)
.then((response) => {
self.$toast.success('Product updated successfully!', {
duration: 3000
})
console.log(response)
this.editedItem = response.data.data
Object.assign(this.products[currentPostIndex], this.editedItem)
}
)
.then((response) => {
self.$toast.success('Product updated successfully!', {
duration: 3000
})
} catch (error) {
console.log(error)
}
console.log(response)
this.editedItem = response.data.data
Object.assign(this.products[currentPostIndex], this.editedItem)
})
.catch((error) => {
console.log(error)
self.$toast.error('something went wrong while trying update!', {
duration: 3000
})
})
},
addMore () {
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