diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2024-07-09 11:43:15 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2024-07-09 11:43:15 +0530 |
commit | 58ecb36f6a98114604952d9dbe78cb99fb159351 (patch) | |
tree | 5604084872fd00cdabc15303440bb4030a78b70f /src/components/PrintPreviewHeader.vue | |
parent | 4a5331dab4838759b8f509e29a0ac676da6604b1 (diff) |
printing user-specific logos and signatures on invoices
Diffstat (limited to 'src/components/PrintPreviewHeader.vue')
-rw-r--r-- | src/components/PrintPreviewHeader.vue | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/components/PrintPreviewHeader.vue b/src/components/PrintPreviewHeader.vue index 9e89c84..62da945 100644 --- a/src/components/PrintPreviewHeader.vue +++ b/src/components/PrintPreviewHeader.vue @@ -1,11 +1,38 @@ <script setup lang="ts"> + import { onMounted, ref } from "vue" + import User from "./../classes/user.js" + import axios from "axios" + const props = defineProps(["invoice"]) + + const user = ref() + + // temporarily using this + // TODO: don't call api from PrintPreview + const getUser = async () => { + user.value = new User() + + try { + const r = await axios.get('/user') + if (r.status === 200) { + user.value = r.data.data + } + } catch (err) { + console.error(err) + } + } + + // TODO: remove + onMounted(() => { + getUser() + }) </script> <template> <div class="print-preview-header"> + <!-- TODO: add option to not use logo --> <div class="logo-container"> - <img src="../assets/placeholderlogo.png"/> + <img :src="'/pub/' + user.LogoFile"/> </div> <div> |