♻️ Use a better method to not create a pointer
This commit is contained in:
@ -10,7 +10,7 @@ const timetable = computed(() => {
|
||||
const currentDay = parsedTimetable.value[timetableDay.value];
|
||||
if (!currentDay) return [];
|
||||
const newDay = currentDay.map((e, index) => {
|
||||
const newElement = JSON.parse(JSON.stringify(e));
|
||||
const newElement = { ...e };
|
||||
newElement.substitution = substitutions.value.find((entry) => {
|
||||
const entryDay = new Date(entry.date).getDay() - 1;
|
||||
return entry.lesson == index + 1 && entryDay == timetableDay.value;
|
||||
|
Reference in New Issue
Block a user