Commit ef2d4838 authored by Le Dinh Trung's avatar Le Dinh Trung

fix upload image function

parent 831cfb88
......@@ -12,7 +12,7 @@
<!-- create modal -->
<b-modal id="modal-create" title="Create Category" class="modal fade" >
<p class="my-4">
<form @submit.prevent="" >
<form @submit.prevent="createCategory" >
<label>Name :</label>
<input
type="text"
......@@ -302,13 +302,17 @@ export default {
ordering: this.ordering,
parent_id: this.parent_id,
image: this.image,
}, {
headers: {
"Content-Type": "multipart/form-data",
"Authorization": "bearer " + this.$auth.$storage.getUniversal("token")
}
})
.then(response => {
// $bvModal.hide('modal-login');
self.$toast.success('Category created successfully!',{
this.$bvModal.hide('modal-create')
self.$toast.success('Category created successfully!', {
duration: 3000
});
console.log(response);
})
})
.catch(errors => {
this.$bvModal.hide('modal-create')
......@@ -318,7 +322,6 @@ export default {
duration: 3000
});
});
},
fileSelected(event){
console.log(event)
......
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