From 987f0351980d5d9cc29f1d70f49258d4250a2bf1 Mon Sep 17 00:00:00 2001 From: Akhil Gupta Date: Wed, 6 Jul 2022 11:00:09 +0530 Subject: [PATCH] fix issue #93 --- README.md | 2 +- ui/src/router/views/settings.vue | 2 +- ui/src/router/views/vehicle.vue | 13 ++++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 152a658..10295a7 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ -->

Hammond

-

Current Version - 2022.04.26

+

Current Version - 2022.07.06

A self-hosted vehicle expense tracking system with support for multiple users. diff --git a/ui/src/router/views/settings.vue b/ui/src/router/views/settings.vue index eb3db3f..6f487b8 100644 --- a/ui/src/router/views/settings.vue +++ b/ui/src/router/views/settings.vue @@ -203,7 +203,7 @@ export default { - + diff --git a/ui/src/router/views/vehicle.vue b/ui/src/router/views/vehicle.vue index 2c1bdfc..101b2fc 100644 --- a/ui/src/router/views/vehicle.vue +++ b/ui/src/router/views/vehicle.vue @@ -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, })
Current Version2022.04.262022.07.06
Website