diff --git a/src/api.ts b/src/api.ts index 630355e..1f48326 100644 --- a/src/api.ts +++ b/src/api.ts @@ -186,12 +186,11 @@ export const sendEmail = async (type: string = "contactForm", data: any, noToken }) } -export const getContent = async (filter: APIParams, params?: APIParams): Promise => { +export const getContent = async (apiParams: APIParams): Promise => { const c = await api("content", { // limit: 1, - params, - filter, sort: "-priority", + ...apiParams, }) if (c?.data?.length) { diff --git a/src/components/routes/Content.svelte b/src/components/routes/Content.svelte index 34afba8..a69cb66 100644 --- a/src/components/routes/Content.svelte +++ b/src/components/routes/Content.svelte @@ -11,7 +11,6 @@ let loading = true let content: Content let connectedContentNotFound: boolean = false - let oldLocation: string $: currentDomain = window.location.protocol + "//" + window.location.host const load = (type?: string) => { @@ -36,8 +35,11 @@ } // Get content by API call + let apiParams: APIParams = { + filter, + } loading = true - getContent(filter) + getContent(apiParams) .then((c) => { if (c) { if (type === "changedLanguage") { diff --git a/src/components/widgets/LanguageChooser.svelte b/src/components/widgets/LanguageChooser.svelte index bb3616e..0987fb8 100644 --- a/src/components/widgets/LanguageChooser.svelte +++ b/src/components/widgets/LanguageChooser.svelte @@ -1,7 +1,6 @@ diff --git a/types/global.d.ts b/types/global.d.ts index 6e24af7..f9263a3 100644 --- a/types/global.d.ts +++ b/types/global.d.ts @@ -16,13 +16,7 @@ interface CollectionEntry { } interface ContentBlock { - layout: 1 | 2 | 3 | 4 - title?: string - subtitle?: string - text?: string - button_text?: string - button_url?: string - images?: ImageEntry[] + article: any } interface Content { @@ -30,6 +24,7 @@ interface Content { locale: string tags?: string[] path: string + name: string blocks: ContentBlock[] }