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
|
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
|
|
||||||
|
|
|
||||||
|
|
@ -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`;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue