When I change the image in an image field, the new image data appears correctly before sending it to the back-end. However, after sending the data, the values are empty!
Code
Commented
save_changes() {
/* eslint-disable */
if (!this.validateForm) return;
console.log("image: ", this.data_local.image); // New image data is present
this.$http
.put(
"/api/admin/posts/meta/" + this.$route.params.id,
this.data_local, // New image data is empty!
{
headers: {
Authorization: localStorage.getItem("access_token"),
},
}
)
.then((res) => {
}
//rest of it...
},
update_avatar(event) {
this.dialogVisible = true;
this.dialogImageUrl = URL.createObjectURL(event.target.files[0]);
this.data_local.image = event.target.files[0]; // Selected image is added to `data_local` object array
},
Screenshots
https://i.stack.imgur.com/NBtic.png
https://i.stack.imgur.com/RceJv.png
Any suggestions?
Update
Header request