perf: limit cut plan to active orders
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 53s

This commit is contained in:
Cauê Faleiros
2026-08-28 13:14:21 -03:00
parent 4122e21dc2
commit 9d99f2387b
3 changed files with 8 additions and 3 deletions

View File

@@ -222,12 +222,13 @@ export const downloadDatabaseDiagnostic = async (): Promise<void> => {
export const fetchProductionOrders = async (
dateRange: DateRange,
filters?: { search?: string },
filters?: { search?: string; activeOnly?: boolean },
options?: CacheOptions
): Promise<ProductionOrderSummary> => {
const params = buildDateRangeParams(dateRange);
const search = filters?.search?.trim();
if (search) params.set('search', search);
if (filters?.activeOnly) params.set('activeOnly', 'true');
const path = `/production-orders?${params.toString()}`;
return getCachedAnalytics(path, async () => {