diff --git a/frontend/pages/item/[id]/index.vue b/frontend/pages/item/[id]/index.vue index 4bcef2c..66018ea 100644 --- a/frontend/pages/item/[id]/index.vue +++ b/frontend/pages/item/[id]/index.vue @@ -30,6 +30,15 @@ refresh(); }); + const lastRoute = ref(route.fullPath); + watchEffect(() => { + if (lastRoute.value.endsWith("edit")) { + refresh(); + } + + lastRoute.value = route.fullPath; + }); + type FilteredAttachments = { attachments: ItemAttachment[]; warranty: ItemAttachment[]; @@ -325,6 +334,36 @@ onClickOutside(refDialogBody, () => { closeDialog(); }); + + function getQRCodeUrl(): string { + const currentURL = window.location.href; + + return `/api/v1/qrcode?data=${encodeURIComponent(currentURL)}&access_token=${api.items.attachmentToken}`; + } + + const currentPath = computed(() => { + return route.path; + }); + + const tabs = computed(() => { + return [ + { + id: "details", + name: "Details", + to: `/item/${itemId.value}`, + }, + { + id: "log", + name: "Log", + to: `/item/${itemId.value}/log`, + }, + { + id: "edit", + name: "Edit", + to: `/item/${itemId.value}/edit`, + }, + ]; + });