Fix: Prevent console message loop on maintenance updates

The console was generating excessive messages after schedule maintenance updates.
This commit is contained in:
Tola Leng
2025-05-26 16:42:05 +08:00
parent 23be1fca0f
commit e74bf35264
7 changed files with 175 additions and 94 deletions
@@ -61,14 +61,12 @@ const getCompletedMaintenance = async (): Promise<MaintenanceItem[]> => {
const createMaintenance = async (data: CreateMaintenanceInput): Promise<void> => {
await createMaintenanceRecord(data);
clearMaintenanceCache(); // Force cache refresh after creation
console.log('Maintenance created and cache cleared');
};
// Update an existing maintenance record
const updateMaintenanceRecord = async (id: string, data: Partial<MaintenanceItem>): Promise<void> => {
await updateMaintenance(id, data);
clearMaintenanceCache(); // Force cache refresh after update
console.log('Maintenance updated and cache cleared');
};
// Refresh cache manually