feat(data): removeHistoryEntry supports optional employeeId

This commit is contained in:
ferdi2go committed 2026-04-28 10:31:38 +00:00
1 parent 23683102bc
commit 7bda92a0a3
2 files changed
+38 -2

No files matched your search

+6 -2
View File
@@ -70,6 +70,10 @@ export function addHistoryEntries(state, entries) {
state.history.sort((a, b) => a.date.localeCompare(b.date));
}
export function removeHistoryEntry(state, isoDate) {
state.history = state.history.filter(h => h.date !== isoDate);
export function removeHistoryEntry(state, isoDate, employeeId) {
if (employeeId === undefined) {
state.history = state.history.filter(h => h.date !== isoDate);
} else {
state.history = state.history.filter(h => !(h.date === isoDate && h.employeeId === employeeId));
}
}