diff --git a/spaces/app.vue b/spaces/app.vue index f454bf2..538eda6 100644 --- a/spaces/app.vue +++ b/spaces/app.vue @@ -1,50 +1,19 @@ diff --git a/spaces/components/DocumentDisplay.vue b/spaces/components/DocumentDisplay.vue index fc26244..cf8107a 100644 --- a/spaces/components/DocumentDisplay.vue +++ b/spaces/components/DocumentDisplay.vue @@ -5,7 +5,7 @@ const supabase = useSupabaseClient() const dataStore = useDataStore() const router = useRouter() const props = defineProps({ - document: { + documentData: { type: Object, required: true }, @@ -13,9 +13,10 @@ const props = defineProps({ type: Boolean, required: false, } + }) -const {document, openShowModal:openShowModalProp } = props; +let {documentData, openShowModal:openShowModalProp } = props; const tags = dataStore.getDocumentTags const openShowModal = ref(false) @@ -27,7 +28,7 @@ const openDocument = async () => { const updateDocument = async () => { - const {url, ...objData} = document + const {url, ...objData} = documentData delete objData.url const {data,error} = await supabase @@ -50,7 +51,7 @@ const createVendorInvoice = async () => { const {data:vendorInvoiceData,error:vendorInvoiceError} = await supabase .from("incomingInvoices") .insert([{ - document: document.id, + document: documentData.id, }]) .select() if(vendorInvoiceError) { @@ -62,7 +63,7 @@ const createVendorInvoice = async () => { .update({ vendorInvoice: vendorInvoiceData[0].id }) - .eq('id',document.id) + .eq('id',documentData.id) .select() if(documentError) { @@ -84,16 +85,18 @@ const createVendorInvoice = async () => { const archiveDocument = () => { - document.tags = ["Archiviert"] + documentData.tags = ["Archiviert"] updateDocument() } + +