From 1d0faf12ea0006c79c7c446bdcfafb81c4a35d3b Mon Sep 17 00:00:00 2001 From: nichenqin Date: Tue, 17 Sep 2024 19:14:03 +0800 Subject: [PATCH] fix: fix always refetch data --- apps/frontend/schema.graphql | 1 + .../src/lib/components/blocks/base/base-detail.svelte | 6 +++--- apps/frontend/src/lib/store/base.store.ts | 2 +- apps/frontend/src/lib/store/modal.store.ts | 6 ++++++ .../src/routes/(authed)/(space)/bases/[baseId]/+layout.gql | 1 + .../src/routes/(authed)/(space)/bases/[baseId]/+page.svelte | 2 +- apps/frontend/src/routes/(authed)/+layout.ts | 6 +++--- packages/graphql/src/index.ts | 1 + 8 files changed, 17 insertions(+), 8 deletions(-) diff --git a/apps/frontend/schema.graphql b/apps/frontend/schema.graphql index a40d055a3..28e765029 100644 --- a/apps/frontend/schema.graphql +++ b/apps/frontend/schema.graphql @@ -13,6 +13,7 @@ type Audit { type Base { id: ID! name: String! + option: JSON share: Share tables: [Table]! } diff --git a/apps/frontend/src/lib/components/blocks/base/base-detail.svelte b/apps/frontend/src/lib/components/blocks/base/base-detail.svelte index 44ab4b11f..505b86cff 100644 --- a/apps/frontend/src/lib/components/blocks/base/base-detail.svelte +++ b/apps/frontend/src/lib/components/blocks/base/base-detail.svelte @@ -1,5 +1,5 @@ diff --git a/apps/frontend/src/routes/(authed)/+layout.ts b/apps/frontend/src/routes/(authed)/+layout.ts index 23b3d588f..b9c7118c9 100644 --- a/apps/frontend/src/routes/(authed)/+layout.ts +++ b/apps/frontend/src/routes/(authed)/+layout.ts @@ -4,11 +4,11 @@ import type { LayoutLoad } from "./$types" export const ssr = false export const load: LayoutLoad = async (event) => { - const redirectURL = encodeURIComponent(event.url.pathname) + // const redirectURL = encodeURIComponent(event.url.pathname) - const search = new URLSearchParams({ redirect: redirectURL }) + // const search = new URLSearchParams({ redirect: redirectURL }) - const me = await event.fetch("/api/me?" + search.toString()) + const me = await event.fetch("/api/me") if (me.redirected) { throw redirect(301, me.url) } diff --git a/packages/graphql/src/index.ts b/packages/graphql/src/index.ts index d4d6763ca..3cc2ba1a8 100644 --- a/packages/graphql/src/index.ts +++ b/packages/graphql/src/index.ts @@ -258,6 +258,7 @@ export class Graphql { type Base { id: ID! name: String! + option: JSON share: Share tables: [Table]!