diff options
Diffstat (limited to 'src/components/PrintPreviewFooter.vue')
-rw-r--r-- | src/components/PrintPreviewFooter.vue | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/components/PrintPreviewFooter.vue b/src/components/PrintPreviewFooter.vue index d41d621..3d1dd4c 100644 --- a/src/components/PrintPreviewFooter.vue +++ b/src/components/PrintPreviewFooter.vue @@ -2,6 +2,32 @@ import Converter from "number-to-words" const props = defineProps(["invoice", "total"]) + + import { onMounted, ref } from "vue" + import User from "./../classes/user.js" + import axios from "axios" + + 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> @@ -61,7 +87,9 @@ </div> <div class="signature-container"> - <img src="../assets/DefaultSignaturePlaceholder.png"/> + <!-- TODO: either show user's signature or a placeholder. maybe use css instead of a whole placeholder png. --> + <!--img src="../assets/DefaultSignaturePlaceholder.png"/--> + <img :src="'/pub/' + user.SignatureFile"/> </div> <div class="tiny"> |