test: course package export and import

This commit is contained in:
Jannat Patel
2026-04-02 18:53:50 +05:30
parent c0df21c076
commit 55f01dc313
4 changed files with 83 additions and 6 deletions
@@ -184,11 +184,8 @@ const exportCourse = async () => {
}
const blob = await response.blob()
// Extract filename from header if present
const disposition = response.headers.get('Content-Disposition')
let filename = 'course.zip'
if (disposition && disposition.includes('filename=')) {
filename = disposition.split('filename=')[1].replace(/"/g, '')
}
@@ -173,7 +173,7 @@ const uploadFile = (e: Event) => {
const importZip = () => {
if (!zip.value) return
call('lms.lms.api.import_course_as_zip', {
call('lms.lms.api.import_course_from_zip', {
zip_file_path: zip.value.file_url,
})
.then((data: any) => {