fix #87
This commit is contained in:
parent
abda2e4025
commit
cf0d4b7c6f
5 changed files with 17 additions and 8 deletions
|
|
@ -1,11 +1,10 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
import { defineStore, storeToRefs } from "pinia";
|
||||
import { usePageStore } from "./page";
|
||||
|
||||
export const useBriefStore = defineStore("brief", () => {
|
||||
async function addPdf(event, briefUri, redirectToParent = false) {
|
||||
const file = event.target.files[0];
|
||||
const { page } = usePageStore();
|
||||
const { page } = storeToRefs(usePageStore());
|
||||
|
||||
if (file) {
|
||||
const formData = new FormData();
|
||||
|
|
@ -20,7 +19,7 @@ export const useBriefStore = defineStore("brief", () => {
|
|||
const result = await response.json();
|
||||
|
||||
if (response.ok) {
|
||||
page.value = result;
|
||||
page.value.steps[0].files.push(result);
|
||||
} else {
|
||||
console.error("Error uploading file:", result.error);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue