Small fixes for vue3

This commit is contained in:
Kloon ImKloon 2023-08-30 18:06:34 +02:00
parent 05d011f586
commit 878f67b7ff
No known key found for this signature in database
GPG Key ID: CCF1C86A995C5B6A
2 changed files with 7 additions and 2 deletions

View File

@ -23,7 +23,11 @@ export async function create(url, password = "", expires = "", unit = "hours") {
}
let body = "{}";
if (password != "" || expires !== "" || unit !== "hours") {
body = JSON.stringify({ password: password, expires: expires, unit: unit });
body = JSON.stringify({
password: password,
expires: expires.toString(), // backend expects string not number
unit: unit,
});
}
return fetchJSON(url, {
method: "POST",

View File

@ -20,6 +20,7 @@
</template>
<script>
import { defineAsyncComponent } from "vue";
import { files as api } from "@/api";
import { mapState, mapActions, mapWritableState } from "pinia";
import { useFileStore } from "@/stores/file";
@ -43,7 +44,7 @@ export default {
Errors,
Preview,
Listing,
Editor: () => import("@/views/files/Editor.vue"),
Editor: defineAsyncComponent(() => import("@/views/files/Editor.vue")),
},
data: function () {
return {