Invalidate stats cache after any ticket-modifying API call
StatsModel::invalidateCache() was never called from any API, so the 60s cached stats persisted after bulk assign/status/priority changes, ticket updates, assignments, and clones. Dashboard tiles showed stale counts until the TTL expired. Added invalidation to the four APIs that affect dashboard stat tiles: - bulk_operation.php: after successful bulk assign/status/priority - assign_ticket.php: after successful reassignment - update_ticket.php: after any successful ticket update - clone_ticket.php: after successful clone (open_tickets changes) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -84,5 +84,7 @@ if (!$success) {
|
||||
http_response_code(500);
|
||||
apiRespond(['success' => false, 'error' => 'Failed to update ticket assignment']);
|
||||
} else {
|
||||
require_once dirname(__DIR__) . '/models/StatsModel.php';
|
||||
(new StatsModel($conn))->invalidateCache();
|
||||
apiRespond(['success' => true]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user