From aa0b9ae02c4adb8b91101f447cc353362828bd2d Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Thu, 11 Jan 2024 17:16:50 +0100 Subject: [PATCH] Fix composable issue --- client/pages/forms/[slug]/show.vue | 192 +++++++----------- client/pages/forms/[slug]/show/share.vue | 75 +++---- .../pages/forms/[slug]/show/submissions.vue | 36 +--- client/pages/privacy-policy.vue | 3 + client/pages/terms-conditions.vue | 3 + client/stores/notion_pages.js | 4 +- 6 files changed, 117 insertions(+), 196 deletions(-) diff --git a/client/pages/forms/[slug]/show.vue b/client/pages/forms/[slug]/show.vue index 7543767..bb7f925 100644 --- a/client/pages/forms/[slug]/show.vue +++ b/client/pages/forms/[slug]/show.vue @@ -20,7 +20,7 @@ {{ form.title }}
- + - + @@ -81,25 +81,25 @@

This form stopped accepting submissions on the {{ - displayClosesDate - }} + displayClosesDate + }} This form will stop accepting submissions on the {{ displayClosesDate }}

The form is now closed because it reached its limit of {{ - form.max_submissions_count - }} submissions. + form.max_submissions_count + }} submissions. This form will stop accepting submissions after {{ form.max_submissions_count }} submissions.

- +
  • {{ tab.name }} @@ -118,7 +118,7 @@
- +
Form not found. @@ -126,126 +126,74 @@
- diff --git a/client/pages/forms/[slug]/show/share.vue b/client/pages/forms/[slug]/show/share.vue index 7986704..2737bff 100644 --- a/client/pages/forms/[slug]/show/share.vue +++ b/client/pages/forms/[slug]/show/share.vue @@ -2,25 +2,25 @@
- + - + - +
- + - + - + - +
- diff --git a/client/pages/forms/[slug]/show/submissions.vue b/client/pages/forms/[slug]/show/submissions.vue index 768519c..83b64d4 100644 --- a/client/pages/forms/[slug]/show/submissions.vue +++ b/client/pages/forms/[slug]/show/submissions.vue @@ -4,32 +4,18 @@
- diff --git a/client/pages/privacy-policy.vue b/client/pages/privacy-policy.vue index d74a93a..1ef420a 100644 --- a/client/pages/privacy-policy.vue +++ b/client/pages/privacy-policy.vue @@ -19,6 +19,9 @@ import {computed} from "vue"; useOpnSeoMeta({ title: 'Privacy Policy' }) +defineRouteRules({ + swr: 3600 +}) const notionPageStore = useNotionPagesStore() await notionPageStore.load('9c97349ceda7455aab9b341d1ff70f79') diff --git a/client/pages/terms-conditions.vue b/client/pages/terms-conditions.vue index ecc57c6..39ac9da 100644 --- a/client/pages/terms-conditions.vue +++ b/client/pages/terms-conditions.vue @@ -19,6 +19,9 @@ import {computed} from "vue"; useOpnSeoMeta({ title: 'Terms & Conditions' }) +defineRouteRules({ + swr: 3600 +}) const notionPageStore = useNotionPagesStore() await notionPageStore.load('246420da2834480ca04047b0c5a00929') diff --git a/client/stores/notion_pages.js b/client/stores/notion_pages.js index a70ee0c..f5031f1 100644 --- a/client/stores/notion_pages.js +++ b/client/stores/notion_pages.js @@ -9,8 +9,8 @@ export const useNotionPagesStore = defineStore('notion_pages', () => { contentStore.startLoading() const apiUrl = opnformConfig.notion.worker - return useOpnApi(`${apiUrl}/page/${pageId}`) - .then(({data})=> { + return useFetch(`${apiUrl}/page/${pageId}`) + .then(({data, error})=> { const val = data.value val['id'] = pageId contentStore.save(val)