From 065dc65e3a26826d32119d4c8d886b91e58ef36b Mon Sep 17 00:00:00 2001 From: Brian DeRocher Date: Sun, 15 Dec 2024 20:09:43 -0500 Subject: [PATCH] Stickers have only ids of organizations, not the entire objects. --- src/components/Sticker.vue | 17 ++++++++++++++++- src/views/StickerBuilderView.vue | 24 ++++++++++++++++-------- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/components/Sticker.vue b/src/components/Sticker.vue index fb136a7..78805e4 100644 --- a/src/components/Sticker.vue +++ b/src/components/Sticker.vue @@ -2,6 +2,7 @@ import QRCode from "@/components/QRCode.vue"; import {computed} from "vue"; import Image from 'primevue/image' +import { type Organization, useOrganization } from '@/queries/organization' const { layout, color, @@ -34,13 +35,25 @@ const layout4Class = computed(() => ({ const color2 = computed(() => { return '#' + color; }) + +const { state: allOrgs } = useOrganization(); + +const myOrgs = computed(() => { + console.log(orgs) + if (allOrgs.value.status !== 'success') { + return []; + } + return allOrgs.value.data.filter((org: Organization) => { + return orgs.includes(org.id); + }); +});