From 0da7cf14e889c015367e0ccef0b4535f4aa3ba17 Mon Sep 17 00:00:00 2001 From: parsa aghaei Date: Wed, 2 Sep 2026 10:35:48 +0330 Subject: [PATCH] fix(products): add clear search button, active filters bar, and fix suitableFor query dto validation --- backend/src/admin/dto/admin-query.dto.ts | 12 + frontend/admin-panel/src/pages/Products.tsx | 101 +- graphify-out/.graphify_labels.json | 48 +- graphify-out/.graphify_labels.json.sig | 2 +- graphify-out/2026-09-02/.graphify_labels.json | 61 +- graphify-out/2026-09-02/GRAPH_REPORT.md | 311 +- graphify-out/2026-09-02/graph.json | 9884 +++++++++-------- graphify-out/2026-09-02/manifest.json | 1260 +-- graphify-out/GRAPH_REPORT.md | 267 +- graphify-out/cache/stat-index.json | 2 +- graphify-out/graph.html | 8 +- graphify-out/graph.json | 9676 ++++++++-------- graphify-out/manifest.json | 1252 +-- 13 files changed, 11542 insertions(+), 11342 deletions(-) diff --git a/backend/src/admin/dto/admin-query.dto.ts b/backend/src/admin/dto/admin-query.dto.ts index 73e95eb3..12949105 100644 --- a/backend/src/admin/dto/admin-query.dto.ts +++ b/backend/src/admin/dto/admin-query.dto.ts @@ -13,8 +13,20 @@ export class AdminQueryDto extends PaginationDto { @IsString() categoryId?: string; + @ApiPropertyOptional({ description: 'فیلتر بر اساس گونه هدف محصول' }) + @IsOptional() + @IsString() + suitableFor?: string; + @ApiPropertyOptional({ description: 'فیلتر بر اساس وضعیت' }) @IsOptional() @IsString() status?: string; + + @ApiPropertyOptional({ description: 'وضعیت موجودی کالا' }) + @IsOptional() + @IsString() + stockStatus?: string; } + +export class AdminProductQueryDto extends AdminQueryDto {} diff --git a/frontend/admin-panel/src/pages/Products.tsx b/frontend/admin-panel/src/pages/Products.tsx index 7d2367c0..61c676c6 100644 --- a/frontend/admin-panel/src/pages/Products.tsx +++ b/frontend/admin-panel/src/pages/Products.tsx @@ -770,7 +770,7 @@ export default function Products() { {/* Filters Bar */}
- + + {search && ( + + )}
- +