MCPcopy Create free account
hub / github.com/code100x/cms / getRootCourseContent

Function getRootCourseContent

src/db/course.ts:217–239  ·  view source on GitHub ↗
(courseId: number)

Source from the content-addressed store, hash-verified

215}
216
217async function getRootCourseContent(courseId: number): Promise<
218 {
219 content: ContentWithMetadata;
220 }[]
221> {
222 const value = await cache.get('getRootCourseContent', [courseId.toString()]);
223 if (value) {
224 return value;
225 }
226 const courseContent = await db.courseContent.findMany({
227 orderBy: [
228 {
229 contentId: 'asc',
230 },
231 ],
232 where: {
233 courseId,
234 },
235 include: { content: true },
236 });
237 cache.set('getRootCourseContent', [courseId.toString()], courseContent);
238 return courseContent;
239}
240
241export function getVideoProgressForUser(
242 userId: string,

Callers 1

getFullCourseContentFunction · 0.85

Calls 2

getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected