feat(frontend): add delete entry and update standby entry logic
All checks were successful
Docker Build and Publish / build-and-push (push) Successful in 33s

This commit is contained in:
2026-01-11 20:07:00 -05:00
parent e5830bc6e0
commit 366253ce19
4 changed files with 61 additions and 11 deletions

View File

@@ -89,7 +89,24 @@ const SupervisorDashboard = ({ user }) => {
<BalanceCard userId={selectedEmployeeId} />
<TimeList entries={employeeEntries} />
<TimeList
entries={employeeEntries}
onEntryDeleted={() => {
// Trigger reload of this employee's entries
// We can just toggle selectedEmployeeId momentarily or just use another state?
// Better: add a refresh dependency to the effect.
// Actually, let's keep it simple: just re-set the ID to trigger effect? No that's ugly.
// Let's just re-fetch in place or add a version state.
// For now, if supervisor deletes, we might want to refresh.
// But Wait, does supervisor have permission to delete?
// User said "delete a time entry owned by the user".
// Assuming supervisor can too, or we just rely on PB permissions.
// I'll add a simple force refresh mechanism.
const currentId = selectedEmployeeId;
setSelectedEmployeeId(null);
setTimeout(() => setSelectedEmployeeId(currentId), 50);
}}
/>
</div>
) : (
<div className="h-full flex items-center justify-center text-gray-400 border-2 border-dashed border-gray-200 rounded-lg">