MCPcopy
hub / github.com/nowork-studio/NotFair / listProjects

Function listProjects

notfair-cmo/src/server/db/projects.ts:22–28  ·  view source on GitHub ↗
(opts: { includeArchived?: boolean } = {})

Source from the content-addressed store, hash-verified

20 | { ok: false; reason: string };
21
22export function listProjects(opts: { includeArchived?: boolean } = {}): Project[] {
23 const db = getDb();
24 const sql = opts.includeArchived
25 ? "SELECT * FROM projects ORDER BY created_at DESC"
26 : "SELECT * FROM projects WHERE archived_at IS NULL ORDER BY created_at DESC";
27 return db.prepare(sql).all() as Project[];
28}
29
30export function getProject(slug: string): Project | null {
31 const db = getDb();

Callers 5

AppSidebarFunction · 0.90
ProjectsListPageFunction · 0.90
getActiveProjectFunction · 0.90
maybePruneCodexOrphansFunction · 0.90
projects.test.tsFile · 0.90

Calls 1

getDbFunction · 0.90

Tested by

no test coverage detected