mirror of
https://github.com/nicetry247/offlineacademy.git
synced 2026-08-21 07:47:32 +00:00
initial commit
This commit is contained in:
Executable
+27
@@ -0,0 +1,27 @@
|
||||
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
|
||||
})
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user