Commit 1d3d31ca authored by TTS Kieu Tuan Anh's avatar TTS Kieu Tuan Anh

fix breadcrumb

parent b9dc5cbf
......@@ -246,13 +246,6 @@ export default {
sUserId: '',
sStatus: null,
sImages: null,
sVariants: [
{
color: "",
size: "",
quantity: "",
},
],
eId: '',
eTitle: '',
eCategoryId: '',
......@@ -311,15 +304,7 @@ export default {
this.sContent= '',
this.sUserId= '',
this.sStatus= '',
this.sImages= null,
this.sVariants= [
{
color: "",
size: "",
quantity: "",
},
];
this.sImages= null
},
editItem(item) {
this.editedIndex = this.posts.indexOf(item)
......@@ -327,12 +312,12 @@ export default {
this.dialog = true
},
deleteItem(item) {
this.editedIndex = this.posts.indexOf(item);
this.editedItem = Object.assign({}, item);
this.editedIndex = this.posts.indexOf(item)
this.editedItem = Object.assign({}, item)
this.dialogDelete = true;
},
deleteItemConfirm() {
this.posts.splice(this.editedIndex, 1);
this.posts.splice(this.editedIndex, 1)
this.closeDelete()
},
close() {
......@@ -345,15 +330,15 @@ export default {
closeDelete() {
this.dialogDelete = false
this.$nextTick(() => {
this.editedItem = Object.assign({}, this.defaultItem);
this.editedItem = Object.assign({}, this.defaultItem)
this.editedIndex = -1
});
},
save() {
if (this.editedIndex > -1) {
Object.assign(this.posts[this.editedIndex], this.editedItem);
Object.assign(this.posts[this.editedIndex], this.editedItem)
} else {
this.posts.push(this.editedItem);
this.posts.push(this.editedItem)
}
this.close()
},
......@@ -391,14 +376,14 @@ export default {
})
.then(response => {
this.$bvModal.hide('modal-create')
self.$toast.success('Product created successfully!', {
self.$toast.success('Post created successfully!', {
duration: 3000
})
})
.catch(errors => {
this.$bvModal.hide('modal-create')
console.log(errors.response.data.message)
this.message = errors.response.data.message;
this.message = errors.response.data.message
self.$toast.error('something went wrong while trying create!',{
duration: 3000
})
......@@ -406,7 +391,7 @@ export default {
},
deletePost(ID,index) {
const self = this;
this.editedIndex = this.posts.indexOf(index);
this.editedIndex = this.posts.indexOf(index)
if(confirm("Do you really want to delete?")){
axios
.delete(`http://127.0.0.1:8000/api/posts/${ID}`)
......@@ -457,7 +442,7 @@ export default {
this.eUserId = item.user_id
// this.eImages = item.images
},
updatePost(ID) {
updatePost() {
const self = this;
axios
.post(`http://127.0.0.1:8000/api/posts/update/${this?.eId}`,{
......@@ -475,7 +460,7 @@ export default {
})
.then(response => {
this.$bvModal.hide('modal-edit')
self.$toast.success('User updated successfully!',{
self.$toast.success('Post updated successfully!',{
duration: 3000
});
console.log(response)
......@@ -488,26 +473,6 @@ export default {
})
})
},
addMore() {
this.variants.push({
color: "",
size: "",
quantity: "",
});
},
addMoreVariant() {
this.eVariants.push({
color: "",
size: "",
quantity: "",
});
},
remove(index) {
this.variants.splice(index, 1)
},
removeVariant(index) {
this.eVariants.splice(index, 1)
},
},
};
</script>
......
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