MCPcopy Create free account
hub / github.com/code100x/daily-code / getCategories

Function getCategories

apps/web/components/utils.tsx:458–471  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

456}
457
458export async function getCategories() {
459 try {
460 const categories = await db.categories.findMany({
461 select: {
462 id: true,
463 category: true,
464 },
465 distinct: ["category"],
466 });
467 return categories;
468 } catch (e) {
469 return [];
470 }
471}
472
473export async function addCategory(category: string) {
474 const newCategory = await db.categories.create({

Callers 1

AdminFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected