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

fix breadcrumb

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