fix api fetch
This commit is contained in:
parent
2960614fa4
commit
5e3f4ec621
2 changed files with 5 additions and 5 deletions
|
|
@ -5,8 +5,7 @@ accept:
|
|||
type: image
|
||||
|
||||
fields:
|
||||
favoriteForClients:
|
||||
favoriteForUsers:
|
||||
label: |
|
||||
Dans les favoris des clients :
|
||||
type: pages
|
||||
query: page('clients').children
|
||||
Dans les favoris des utilisateurs :
|
||||
type: users
|
||||
|
|
|
|||
|
|
@ -32,8 +32,9 @@ export const useApiStore = defineStore("api", () => {
|
|||
*/
|
||||
async function fetchPageData(path = window.location.pathname) {
|
||||
const isHomePage = path === "/";
|
||||
path = isHomePage ? "/home" : path;
|
||||
path = path === "/" ? "/home" : path;
|
||||
path = path.startsWith("/") ? path : "/" + path;
|
||||
path = path.endsWith("/") ? path.substring(0, path.length - 1) : path;
|
||||
|
||||
const url = `${window.location.origin}${path}.json`;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue