wip fix
This commit is contained in:
parent
21fa871b92
commit
3dd306bc87
|
|
@ -38,7 +38,7 @@ export const _ = {
|
||||||
where: { id_site: site.id },
|
where: { id_site: site.id },
|
||||||
});
|
});
|
||||||
|
|
||||||
if (cgroups) {
|
if (Array.isArray(cgroups)) {
|
||||||
site.cgroup_ids = [];
|
site.cgroup_ids = [];
|
||||||
for (const id of cgroups.map((c) => c.use_id_site)) {
|
for (const id of cgroups.map((c) => c.use_id_site)) {
|
||||||
site.cgroup_ids.push(id);
|
site.cgroup_ids.push(id);
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ const cachedQueryResult: Record<
|
||||||
|
|
||||||
export const fetchSendDb = async (params: any, dburl: string) => {
|
export const fetchSendDb = async (params: any, dburl: string) => {
|
||||||
const base = new URL(dburl);
|
const base = new URL(dburl);
|
||||||
base.pathname = `/_dbs/`;
|
base.pathname = `/_dbs`;
|
||||||
if (params.table) {
|
if (params.table) {
|
||||||
base.pathname += `/${params.table}`;
|
base.pathname += `/${params.table}`;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ export const SiteManager = () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const reloadSites = async () => {
|
const reloadSites = async () => {
|
||||||
|
|
||||||
const orgs = await db.org_user.findMany({
|
const orgs = await db.org_user.findMany({
|
||||||
where: {
|
where: {
|
||||||
id_user: p.session.data.user.id,
|
id_user: p.session.data.user.id,
|
||||||
|
|
@ -32,6 +31,7 @@ export const SiteManager = () => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(orgs);
|
||||||
if (orgs) {
|
if (orgs) {
|
||||||
orgs.push({
|
orgs.push({
|
||||||
org: {
|
org: {
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,9 @@ export const ToolbarCenter = () => {
|
||||||
try {
|
try {
|
||||||
local.apiStatus = "starting";
|
local.apiStatus = "starting";
|
||||||
local.render();
|
local.render();
|
||||||
await fetch(p.site.api_url + "/_prasi/_");
|
if (p.site.api_url) {
|
||||||
|
await fetch(p.site.api_url + "/_prasi/_");
|
||||||
|
}
|
||||||
local.apiStatus = "started";
|
local.apiStatus = "started";
|
||||||
local.render();
|
local.render();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ export const devLoader: Loader = {
|
||||||
select: { use_id_site: true },
|
select: { use_id_site: true },
|
||||||
});
|
});
|
||||||
|
|
||||||
if (cgroups) {
|
if (Array.isArray(cgroups)) {
|
||||||
site.cgroup_ids = [];
|
site.cgroup_ids = [];
|
||||||
for (const id of cgroups.map((c: any) => c.use_id_site)) {
|
for (const id of cgroups.map((c: any) => c.use_id_site)) {
|
||||||
site.cgroup_ids.push(id);
|
site.cgroup_ids.push(id);
|
||||||
|
|
@ -46,7 +46,7 @@ export const devLoader: Loader = {
|
||||||
select: { content_tree: true, id: true },
|
select: { content_tree: true, id: true },
|
||||||
});
|
});
|
||||||
|
|
||||||
if (layout) {
|
if (layout && layout.content_tree) {
|
||||||
const childs = (layout.content_tree as any).childs;
|
const childs = (layout.content_tree as any).childs;
|
||||||
if (childs && childs.length > 0) {
|
if (childs && childs.length > 0) {
|
||||||
site.layout = childs[0];
|
site.layout = childs[0];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue