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

upload post image fixed

parent d318b797
...@@ -591,19 +591,19 @@ export default { ...@@ -591,19 +591,19 @@ export default {
}, },
createPost () { createPost () {
const self = this const self = this
const fd = new FormData()
fd.append('title', this.title)
fd.append('category_id', this.category_id)
fd.append('content', this.content)
fd.append('images', this.images)
fd.append('user_id', this.user_id)
fd.append('status', this.statu)
this.$axios this.$axios
.post('/posts/', .post('/posts/',
{ fd,
title: this.title,
category_id: this.category_id,
content: this.content,
images: this.images,
user_id: this.user_id,
status: this.status
},
{ {
headers: { headers: {
'Content-Type': 'application/json; multipart/form-data; boundary=---------------------------974767299852498929531610575 ', 'Content-Type': 'multipart/form-data',
Authorization: `Bearer ${this.$auth.$storage.getUniversal('token')}` Authorization: `Bearer ${this.$auth.$storage.getUniversal('token')}`
} }
} }
......
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