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

Function getAllProblems

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

Source from the content-addressed store, hash-verified

60}
61
62export async function getAllProblems() {
63 const value = await cache.get("getAllProblems", []);
64 if (value) {
65 return value;
66 }
67 try {
68 const problems = await db.problem.findMany({
69 orderBy: {
70 id: "desc",
71 },
72 });
73 await cache.set("getAllProblems", [], problems);
74 return problems;
75 } catch (e) {
76 return [];
77 }
78}
79
80export async function updateProblem(problemId: string, data: Problem) {
81 try {

Callers 1

AdminFunction · 0.90

Calls 2

getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected