Skip to content

Commit

Permalink
COM-3857: fix review
Browse files Browse the repository at this point in the history
  • Loading branch information
Aude committed Dec 4, 2024
1 parent 03b1f60 commit ebe4c4c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
6 changes: 2 additions & 4 deletions src/core/components/courses/AttendanceSheetAdditionModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ export default {
const groupedSlots = groupBy(slots.value, 'step');
return Object.keys(stepsById.value).reduce((acc, step) => {
if (groupedSlots[step]) {
acc[step] = groupedSlots[step];
}
if (groupedSlots[step]) { acc[step] = groupedSlots[step]; }
return acc;
}, {});
Expand All @@ -85,7 +83,7 @@ export default {
.map(slotGroup => slotGroup.sort(ascendingSortBy('startDate'))
.map(s => ({
label: `${CompaniDate(s.startDate).format(`${DD_MM_YYYY} ${HH_MM}`)}
- ${CompaniDate(s.endDate).format(HH_MM)}`,
- ${CompaniDate(s.endDate).format(HH_MM)}`,
value: s._id,
})))
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default {
.map(slotGroup => slotGroup.sort(ascendingSortBy('startDate'))
.map(s => ({
label: `${CompaniDate(s.startDate).format(`${DD_MM_YYYY} ${HH_MM}`)}
- ${CompaniDate(s.endDate).format(HH_MM)}`,
- ${CompaniDate(s.endDate).format(HH_MM)}`,
value: s._id,
})))
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const useAttendanceSheets = (
const attendanceSheets = ref([]);
const newAttendanceSheet = ref({ course: course.value._id });
const editedAttendanceSheet = ref({ _id: '', slots: [], trainee: {} });
const editionSlotsGroupedByStep = ref([]);
const editionSlotsGroupedByStep = ref({});
const attendanceSheetColumns = ref([
{
name: 'date',
Expand Down Expand Up @@ -219,9 +219,7 @@ export const useAttendanceSheets = (

const groupedSlots = groupBy([...linkedSlots, ...notLinkedSlotOptions.value], 'step');
editionSlotsGroupedByStep.value = Object.keys(stepsById.value).reduce((acc, step) => {
if (groupedSlots[step]) {
acc[step] = groupedSlots[step];
}
if (groupedSlots[step]) { acc[step] = groupedSlots[step]; }
return acc;
}, {});

Expand Down Expand Up @@ -252,7 +250,7 @@ export const useAttendanceSheets = (
const resetAttendanceSheetEditionModal = () => {
v$.value.editedAttendanceSheet.$reset();
editedAttendanceSheet.value = { _id: '', slots: [], trainee: {} };
editionSlotsGroupedByStep.value = [];
editionSlotsGroupedByStep.value = {};
};

return {
Expand Down

0 comments on commit ebe4c4c

Please sign in to comment.