From 1d96d9b83ea70d756623ff7c2e0fca62b8366783 Mon Sep 17 00:00:00 2001 From: joe-irving Date: Tue, 11 Jun 2024 00:43:34 +0100 Subject: [PATCH] add component for counter --- components/PetitionPage.vue | 8 ++++--- components/PetitionSignatureCounter.vue | 24 +++++++++++++++++++ composables/useGetNextTarget.ts | 31 +++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 components/PetitionSignatureCounter.vue create mode 100644 composables/useGetNextTarget.ts diff --git a/components/PetitionPage.vue b/components/PetitionPage.vue index 723666d..2c50d6e 100644 --- a/components/PetitionPage.vue +++ b/components/PetitionPage.vue @@ -12,9 +12,9 @@ const { data: petition } = await $client.petition.getPublic.useQuery({ id: props.id }) const { data: theme } = petition.value?.petitionCampaign?.styleThemeId ? await $client.styleTheme.get.useQuery(petition.value?.petitionCampaign?.styleThemeId) : { data: undefined } -// const { data: signatures } = $client.petition.signatureCount.useQuery({ -// id: props.id -// }) +const { data: signatures } = $client.petition.signatureCount.useQuery({ + id: props.id +}) const shareUrl = ref(useShareUrl(petition.value?.slug || '')) const success = ref(false) @@ -46,6 +46,7 @@ useSeoMeta({