Skip to content

Commit c124218

Browse files
committed
fix(Export): now exporting json file with good mime type and charset (application/json;charset=utf-8
1 parent 5809007 commit c124218

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pages/administration/exercices/index.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,9 @@
430430
try {
431431
const result = await this.$axios.$post('/api/export', {data: {exercise_ids: this.selectedExercises}});
432432
433-
download(JSON.stringify(result), "export.json", 'application/json');
433+
const blob = new Blob([JSON.stringify(result)], {type: 'application/json;charset=utf-8;'});
434+
435+
download(blob, "export.json", 'application/json;charset=utf-8;');
434436
435437
this.$displaySuccess("L'export a bien été effectué.");
436438
this.selectedExercises = [];
@@ -472,7 +474,9 @@
472474
473475
const result = await this.$axios.$post('/api/export', exportExerciseRequest);
474476
475-
download(JSON.stringify(result), "export.json", 'application/json');
477+
const blob = new Blob([JSON.stringify(result)], {type: 'application/json;charset=utf-8;'});
478+
479+
download(blob, "export.json", 'application/json;charset=utf-8;');
476480
477481
this.$displaySuccess("L'export a bien été effectué.");
478482
this.selectedExercises = [];

0 commit comments

Comments
 (0)