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

Function getAllCategories

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

Source from the content-addressed store, hash-verified

315}
316
317export async function getAllCategories() {
318 const value = await cache.get("getAllCategories", []);
319 if (value) {
320 return value;
321 }
322 try {
323 const categories = await db.categories.findMany({
324 select: {
325 id: true,
326 category: true,
327 },
328 distinct: ["category"],
329 });
330 await cache.set("getAllCategories", [], categories);
331 return categories;
332 } catch (e) {
333 return [];
334 }
335}
336
337export async function getAllMCQs() {
338 const value = await cache.get("getAllMCQs", []);

Callers 2

TracksEditorFunction · 0.90
LandingFunction · 0.90

Calls 2

getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected