MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / rollbackUsage

Function rollbackUsage

api/src/routes/protected/socrates.ts:88–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86 const attempts = usage.count;
87
88 const rollbackUsage = async () => {
89 await fastify.prisma.socratesUsage.update({
90 where: {
91 userId_date: { userId: req.user!.id, date: todayUTC }
92 },
93 data: { count: { decrement: 1 } }
94 });
95 };
96
97 try {
98 const response = await fetch(`${SOCRATES_ENDPOINT}/hint`, {

Callers 1

socratesRoutesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected