mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-24 07:39:41 +02:00
fix broken upload button on migrations
This commit is contained in:
parent
f48f55b6dc
commit
fbf4282063
4 changed files with 6 additions and 1 deletions
|
@ -3,6 +3,8 @@ import { apiReq } from "./api-utils";
|
||||||
export const utilsAPI = {
|
export const utilsAPI = {
|
||||||
// import { api } from "@/api";
|
// import { api } from "@/api";
|
||||||
async uploadFile(url, fileObject) {
|
async uploadFile(url, fileObject) {
|
||||||
|
console.log("API Called");
|
||||||
|
|
||||||
let response = await apiReq.post(url, fileObject, {
|
let response = await apiReq.post(url, fileObject, {
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "multipart/form-data",
|
"Content-Type": "multipart/form-data",
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
:url="`/api/migrations/${folder}/upload`"
|
:url="`/api/migrations/${folder}/upload`"
|
||||||
fileName="archive"
|
fileName="archive"
|
||||||
@uploaded="$emit('refresh')"
|
@uploaded="$emit('refresh')"
|
||||||
|
:post="true"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
file-name="image"
|
file-name="image"
|
||||||
:text-btn="false"
|
:text-btn="false"
|
||||||
@uploaded="uploadImage"
|
@uploaded="uploadImage"
|
||||||
|
:post="false"
|
||||||
/>
|
/>
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
<v-card-text class="mt-n5">
|
<v-card-text class="mt-n5">
|
||||||
|
|
|
@ -46,11 +46,12 @@ export default {
|
||||||
if (this.file != null) {
|
if (this.file != null) {
|
||||||
this.isSelecting = true;
|
this.isSelecting = true;
|
||||||
|
|
||||||
if (this.post) {
|
if (!this.post) {
|
||||||
this.$emit(UPLOAD_EVENT, this.file);
|
this.$emit(UPLOAD_EVENT, this.file);
|
||||||
this.isSelecting = false;
|
this.isSelecting = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let formData = new FormData();
|
let formData = new FormData();
|
||||||
formData.append(this.fileName, this.file);
|
formData.append(this.fileName, this.file);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue