Commit 05ade267 authored by TTS Kieu Tuan Anh's avatar TTS Kieu Tuan Anh

add create category instant

parent feefefc1
...@@ -335,6 +335,9 @@ export default { ...@@ -335,6 +335,9 @@ export default {
self.$toast.success('Category created successfully!', { self.$toast.success('Category created successfully!', {
duration: 3000 duration: 3000
}) })
this.editedItem = response.data.data
console.log(this.editedItem)
this.categories.push(this.editedItem)
}) })
.catch(errors => { .catch(errors => {
this.$bvModal.hide('modal-create') this.$bvModal.hide('modal-create')
...@@ -354,6 +357,7 @@ export default { ...@@ -354,6 +357,7 @@ export default {
console.log(this.image) console.log(this.image)
}, },
deleteCategory(ID,index) { deleteCategory(ID,index) {
const self = this
this.editedIndex = this.categories.indexOf(index); this.editedIndex = this.categories.indexOf(index);
if(confirm("Do you really want to delete?")){ if(confirm("Do you really want to delete?")){
try{ try{
......
...@@ -382,7 +382,6 @@ export default { ...@@ -382,7 +382,6 @@ export default {
try{ try{
axios axios
.put(`http://127.0.0.1:8000/api/users/${this?.eID}`,{ .put(`http://127.0.0.1:8000/api/users/${this?.eID}`,{
email: this.eEmail, email: this.eEmail,
password: this.ePassword, password: this.ePassword,
name:this.eName,} ) name:this.eName,} )
......
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