Added E-Mail Sending

This commit is contained in:
2024-09-30 18:34:16 +02:00
parent a75506b183
commit 782f97afcc
6 changed files with 681 additions and 34 deletions

View File

@@ -9,16 +9,19 @@ defineShortcuts({
},
})
const supabase = useSupabaseClient()
const dataStore = useDataStore()
const route = useRoute()
const router = useRouter()
const itemInfo = ref({})
const linkedDocument =ref({})
const setupPage = () => {
const setupPage = async () => {
if(route.params) {
if(route.params.id) itemInfo.value = dataStore.getCreatedDocumentById(Number(route.params.id))
if(route.params.id) itemInfo.value = await useSupabaseSelectSingle("createddocuments",route.params.id,"*")
linkedDocument.value = (await supabase.from("documents").select("id").eq("createdDocument", route.params.id).single()).data
}
}
@@ -47,9 +50,17 @@ setupPage()
>
Übernehmen
</UButton>
<UButton
@click="router.push(`/email/new?loadDocuments=[${linkedDocument.id}]`)"
icon="i-heroicons-envelope"
>
E-Mail
</UButton>
</template>
</UDashboardToolbar>
{{linkedDocument}}
<object
:data="dataStore.documents.find(i => i.createdDocument === itemInfo.id) ? dataStore.documents.find(i => i.createdDocument === itemInfo.id).url : ''"
class="h-full"