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

Function getCourse

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

Source from the content-addressed store, hash-verified

119}
120
121export async function getCourse(courseId: number) {
122 const value = await cache.get('getCourse', [courseId.toString()]);
123 if (value) {
124 return value;
125 }
126
127 const courses = db.course.findFirst({
128 where: {
129 id: courseId,
130 },
131 });
132 cache.set('getCourse', [courseId.toString()], courses);
133 return courses;
134}
135
136export const getNextVideo = async (currentVideoId: number) => {
137 if (!currentVideoId) {

Callers 4

CourseFunction · 0.90
CourseFunction · 0.90
UpdateCourseContentFunction · 0.90
UpdateCourseContentFunction · 0.90

Calls 2

getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected