feat(data): removeHistoryEntry supports optional employeeId
This commit is contained in:
1 parent
23683102bc
commit
7bda92a0a3
2 files changed
+38
-2
No files matched your search
+6
-2
@@ -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));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user