Commit 72ded375 authored by TTS Kieu Tuan Anh's avatar TTS Kieu Tuan Anh

remove

parent e6ee12b8
...@@ -352,7 +352,7 @@ export default { ...@@ -352,7 +352,7 @@ export default {
console.log(event) console.log(event)
const file = event.target.files[0] const file = event.target.files[0]
this.url = URL.createObjectURL(file) this.url = URL.createObjectURL(file)
this.image = file; this.image = file
console.log(file) console.log(file)
console.log(this.image) console.log(this.image)
}, },
...@@ -364,7 +364,7 @@ export default { ...@@ -364,7 +364,7 @@ export default {
this.$axios this.$axios
.delete(`/categories/${ID}`) .delete(`/categories/${ID}`)
.then(response => { .then(response => {
this.categories.splice(this.editedIndex, 1); this.categories.splice(this.editedIndex, 1)
self.$toast.success('Category deleted successfully!',{ self.$toast.success('Category deleted successfully!',{
duration: 3000 duration: 3000
}) })
......
...@@ -183,7 +183,7 @@ ...@@ -183,7 +183,7 @@
</v-toolbar> </v-toolbar>
</template> </template>
<template v-slot:item.actions="{ item }"> <template v-slot:item.actions="{ item }">
<v-icon small class="mr-2" @click=" editUser(item);" :id ="item.id"> mdi-pencil </v-icon> <v-icon small class="mr-2" @click=" editUser(item)" :id ="item.id"> mdi-pencil </v-icon>
<v-icon small @click="deleteUser(item.id, item)" :id ="item.id"> mdi-delete </v-icon> <v-icon small @click="deleteUser(item.id, item)" :id ="item.id"> mdi-delete </v-icon>
</template> </template>
<template v-slot:no-data> <template v-slot:no-data>
...@@ -250,7 +250,7 @@ export default { ...@@ -250,7 +250,7 @@ export default {
}, },
computed: { computed: {
formTitle() { formTitle() {
return this.editedIndex === -1 ? "New Item" : "Edit Item"; return this.editedIndex === -1 ? "New Item" : "Edit Item"
}, },
}, },
watch: { watch: {
...@@ -289,14 +289,14 @@ export default { ...@@ -289,14 +289,14 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.editedItem = Object.assign({}, this.defaultItem) this.editedItem = Object.assign({}, this.defaultItem)
this.editedIndex = -1 this.editedIndex = -1
}); })
}, },
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) {
...@@ -304,15 +304,15 @@ export default { ...@@ -304,15 +304,15 @@ export default {
} else { } else {
this.users.push(this.editedItem) this.users.push(this.editedItem)
} }
this.close(); this.close()
}, },
getUsers() { getUsers() {
this.$axios this.$axios
.get('/users/') .get('/users/')
.then((response) => (this.users = response.data.data.data)) .then((response) => (this.users = response.data.data.data))
.catch(function (error) { .catch(function (error) {
console.log(error); console.log(error)
}); })
}, },
createUser() { createUser() {
const self = this const self = this
...@@ -330,7 +330,7 @@ export default { ...@@ -330,7 +330,7 @@ export default {
this.$bvModal.hide('modal-login') this.$bvModal.hide('modal-login')
self.$toast.success('User created successfully!',{ self.$toast.success('User created successfully!',{
duration: 3000 duration: 3000
}); })
console.log(response) console.log(response)
this.editedItem = response.data.data this.editedItem = response.data.data
console.log(this.editedItem) console.log(this.editedItem)
...@@ -343,8 +343,8 @@ export default { ...@@ -343,8 +343,8 @@ export default {
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
}); })
}); })
}, },
deleteUser(userID, index) { deleteUser(userID, index) {
const self = this const self = this
...@@ -387,7 +387,7 @@ export default { ...@@ -387,7 +387,7 @@ export default {
.then(response => { .then(response => {
self.$toast.success('User updated successfully!',{ self.$toast.success('User updated successfully!',{
duration: 3000 duration: 3000
}); })
console.log(response) console.log(response)
this.editedItem = response.data.data this.editedItem = response.data.data
this.$bvModal.hide('modal-edit') this.$bvModal.hide('modal-edit')
......
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