fix api fetch

This commit is contained in:
isUnknown 2024-09-11 06:09:34 +02:00
parent 2960614fa4
commit 5e3f4ec621
2 changed files with 5 additions and 5 deletions

View file

@ -5,8 +5,7 @@ accept:
type: image type: image
fields: fields:
favoriteForClients: favoriteForUsers:
label: | label: |
Dans les favoris des clients : Dans les favoris des utilisateurs :
type: pages type: users
query: page('clients').children

View file

@ -32,8 +32,9 @@ export const useApiStore = defineStore("api", () => {
*/ */
async function fetchPageData(path = window.location.pathname) { async function fetchPageData(path = window.location.pathname) {
const isHomePage = path === "/"; const isHomePage = path === "/";
path = isHomePage ? "/home" : path; path = path === "/" ? "/home" : path;
path = path.startsWith("/") ? path : "/" + path; path = path.startsWith("/") ? path : "/" + path;
path = path.endsWith("/") ? path.substring(0, path.length - 1) : path;
const url = `${window.location.origin}${path}.json`; const url = `${window.location.origin}${path}.json`;