mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-21 14:08:15 +02:00
Improve product search functionality and data caching
Add server-side search and filtering for DLC products, and implement client-side debouncing for search terms. Optimize data fetching with extended stale times for stores, suppliers, and DLC stats to improve performance. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 78d55416-09d3-4c00-b411-444299b0da00 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/78d55416-09d3-4c00-b411-444299b0da00/WSwf4nZ
This commit is contained in:
1 parent
b172870ef9
commit
48bfc884ed
3 files changed
+86
-66
No files matched your search
+2
-3
@@ -986,7 +986,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
return res.status(404).json({ message: "User not found" });
|
||||
}
|
||||
|
||||
const { storeId, status, supplierId } = req.query;
|
||||
const { storeId, status, supplierId, search } = req.query;
|
||||
let groupIds: number[] | undefined;
|
||||
|
||||
if (user.role === 'admin') {
|
||||
@@ -1003,10 +1003,9 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
const filters: any = {};
|
||||
if (status && status !== 'all') filters.status = status as string;
|
||||
if (supplierId && supplierId !== 'all') filters.supplierId = parseInt(supplierId as string);
|
||||
if (search) filters.search = search as string;
|
||||
|
||||
console.log('DLC Products API called with:', { groupIds, filters, userRole: user.role });
|
||||
const dlcProducts = await storage.getDlcProducts(groupIds, filters);
|
||||
console.log('DLC Products returned:', dlcProducts.length, 'items');
|
||||
res.json(dlcProducts);
|
||||
} catch (error) {
|
||||
console.error("Error fetching DLC products:", error);
|
||||
|
||||
Reference in new issue
Block a user