This commit is contained in:
Rizky 2024-03-01 15:57:27 +07:00
parent ea70a7f43b
commit 73ecc7b921
4 changed files with 27 additions and 9 deletions

File diff suppressed because one or more lines are too long

View File

@ -148,7 +148,6 @@ export const apiProxy = (api_url: string) => {
}
);
} catch (e) {
console.warn("Init API failed for URL: ", JSON.stringify(api_url));
return null;
}
};
@ -158,4 +157,3 @@ const fetchSendApi = async (url: string, params: any) => {
"content-type": "application/json",
});
};

View File

@ -23,7 +23,9 @@ const start = async () => {
await loadApiProxyDef(base_url, false);
w._api = apiProxy(base_url);
} catch (e) {
console.warn("Failed to load API:", base_url);
if (cur.host) {
console.warn("Failed to load API:", base_url);
}
}
w.serverurl = base_url;

View File

@ -91,7 +91,13 @@ export const edInitSync = (p: PG) => {
site: params.site_id
? { id: params.site_id }
: {
id_user: p.user.id,
org: {
org_user: {
some: {
id_user: p.user.id,
},
},
},
},
name: {
contains: "root",
@ -114,10 +120,16 @@ export const edInitSync = (p: PG) => {
site: params.site_id
? { id: params.site_id }
: {
id_user: p.user.id,
org: {
org_user: {
some: {
id_user: p.user.id,
},
},
},
},
name: {
contains: "home",
contains: "home",
mode: "insensitive",
},
},
@ -133,7 +145,13 @@ export const edInitSync = (p: PG) => {
site: params.site_id
? { id: params.site_id }
: {
id_user: p.user.id,
org: {
org_user: {
some: {
id_user: p.user.id,
},
},
},
},
},
select: { id: true, id_site: true },