Skip to content

Commit

Permalink
Merge pull request #45 from hotungkhanh/kan-48/send-user-input
Browse files Browse the repository at this point in the history
fix: filter units with no students
  • Loading branch information
dh-giang-vu authored Oct 9, 2024
2 parents 2b5453e + ccdd631 commit dc793d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/scripts/handleInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ export async function prefillUnitSpreadsheet(enrolmentExcel: File) {

const units = unitsMaps.map(m => {
const unitsData = Array.from(m.values());
const transformed = unitsData.map(ud => { return { ...ud, enrolment: JSON.stringify(ud.enrolment) } });
const transformed = unitsData
.filter((ud) => ud.enrolment.length > 0)
.map(ud => { return { ...ud, enrolment: JSON.stringify(ud.enrolment) } });
return transformed;
}).flat();

Expand Down

0 comments on commit dc793d0

Please sign in to comment.