This commit is contained in:
Akhil Gupta
2022-07-06 11:00:09 +05:30
parent 7cb9a43dfe
commit 987f035198
3 changed files with 12 additions and 5 deletions

View File

@@ -8,7 +8,7 @@
</a> -->
<h1 align="center" style="margin-bottom:0">Hammond</h1>
<p align="center">Current Version - 2022.04.26</p>
<p align="center">Current Version - 2022.07.06</p>
<p align="center">
A self-hosted vehicle expense tracking system with support for multiple users.

View File

@@ -203,7 +203,7 @@ export default {
<table class="table is-hoverable">
<tr>
<td>Current Version</td>
<td>2022.04.26</td>
<td>2022.07.06</td>
</tr>
<tr>
<td>Website</td>

View File

@@ -199,14 +199,21 @@ export default {
return
}
this.tryingToUpload = true
const formData = new FormData()
formData.append('file', this.file, this.file.name)
formData.append('title', this.title)
axios
.post(`/api/vehicles/${this.vehicle.id}/attachments`, formData)
// const config = { headers: { 'Content-Type': 'multipart/form-data; boundary=' + formData._boundary } }
fetch(`/api/vehicles/${this.vehicle.id}/attachments`, {
method: 'POST',
body: formData,
headers: {
Authorization: this.currentUser.token,
},
})
.then((data) => {
this.$buefy.toast.open({
message: 'Quick Entry Created Successfully',
message: 'File uploaded Successfully',
type: 'is-success',
duration: 3000,
})