From 25224e03432f048aaa9a208bc00e48d9428e0750 Mon Sep 17 00:00:00 2001 From: Milo Schwartz Date: Sat, 26 Oct 2024 22:02:58 -0400 Subject: [PATCH] uncomment orgs list for dropdown --- server/db/index.ts | 2 +- server/routers/org/listOrgs.ts | 2 -- src/app/[orgId]/layout.tsx | 23 ++++++++++++----------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/server/db/index.ts b/server/db/index.ts index 62be6134..3270d6df 100644 --- a/server/db/index.ts +++ b/server/db/index.ts @@ -1,7 +1,7 @@ import { drizzle } from "drizzle-orm/better-sqlite3"; import Database from "better-sqlite3"; import * as schema from "@server/db/schema"; -import config, { APP_PATH } from "@server/config"; +import { APP_PATH } from "@server/config"; import path from "path"; const location = path.join(APP_PATH, "db", "db.sqlite"); diff --git a/server/routers/org/listOrgs.ts b/server/routers/org/listOrgs.ts index 1bb1393b..8b8ae68b 100644 --- a/server/routers/org/listOrgs.ts +++ b/server/routers/org/listOrgs.ts @@ -79,8 +79,6 @@ export async function listOrgs( .where(inArray(orgs.orgId, userOrgIds)); const totalCount = totalCountResult[0].count; - logger.debug("here2") - return response(res, { data: { orgs: organizations, diff --git a/src/app/[orgId]/layout.tsx b/src/app/[orgId]/layout.tsx index 0b7a66d7..291c37db 100644 --- a/src/app/[orgId]/layout.tsx +++ b/src/app/[orgId]/layout.tsx @@ -68,17 +68,18 @@ export default async function ConfigurationLaytout( } let orgs: ListOrgsResponse["orgs"] = []; - // try { - // const res = await internal.get>( - // `/orgs`, - // cookie - // ); - // if (res && res.data.data.orgs) { - // orgs = res.data.data.orgs; - // } - // } catch (e) { - // console.error("Error fetching orgs", e); - // } + try { + const res = await internal.get>( + `/orgs`, + cookie + ); + if (res && res.data.data.orgs) { + orgs = res.data.data.orgs; + } + } catch (e) { + console.error("Error fetching orgs", e); + } + return ( <>