mirror of
https://github.com/nicetry247/offlineacademy.git
synced 2026-07-26 11:58:44 +00:00
27 lines
679 B
TypeScript
Executable File
27 lines
679 B
TypeScript
Executable File
export function saveProgressFn(lessonId: string, courseId: string, moduleId: string, position: number) {
|
|
return fetch('/api/progress', {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify({
|
|
lessonId,
|
|
courseId,
|
|
moduleId,
|
|
position,
|
|
completed: false
|
|
})
|
|
})
|
|
}
|
|
|
|
export function markCompleteFn(lessonId: string, courseId: string, moduleId: string, position: number) {
|
|
return fetch('/api/progress', {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify({
|
|
lessonId,
|
|
courseId,
|
|
moduleId,
|
|
position,
|
|
completed: true
|
|
})
|
|
})
|
|
} |