fix(employees): remove history entries when deleting an employee (#5)

removeEmployee now also filters the deleted employee's history entries, so
no orphaned "(unbekannt)" rows remain. Adds a test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ferdi2goandClaude Opus 4.8 committed 2026-06-03 12:29:16 +00:00
1 parent 7b53618921
commit 142e0efa1f
2 files changed
+19 -1

No files matched your search

+2
View File
@@ -109,6 +109,8 @@ export function createEmployee(name) {
export function removeEmployee(state, id) {
state.employees = state.employees.filter(e => e.id !== id);
// Also drop the employee's history entries so no orphaned "(unbekannt)" rows remain
state.history = state.history.filter(h => h.employeeId !== id);
}
export function toggleHoliday(state, isoDate) {