From 550da7fb4750d301f63b104afdd530a0bb6152a6 Mon Sep 17 00:00:00 2001 From: timotheegoguely Date: Mon, 9 Sep 2024 20:08:13 +0200 Subject: [PATCH] Update stores/api.js: remove slash for url to work with Inspirations, but need to fix for Home --- src/stores/api.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/stores/api.js b/src/stores/api.js index f3aaad7..acbc4b7 100644 --- a/src/stores/api.js +++ b/src/stores/api.js @@ -31,10 +31,13 @@ export const useApiStore = defineStore("counter", () => { * }); */ async function fetchPageData(path = window.location.pathname) { + + // TODO: Fix url for Home AND Inspirations + const isHomePage = path === "/"; const url = isHomePage ? `${window.location.origin}/home.json` - : `${window.location.origin}/${path}.json`; + : `${window.location.origin}${path}.json`; try { const response = await fetch(url);