Include archived products in catalog search

This commit is contained in:
lizerk 2026-08-18 09:53:16 +03:00
parent 5a22d9b2a3
commit 0b63da0876

View File

@ -9,6 +9,7 @@ import {
ArrowDownAZ,
ArrowLeft,
ArrowRight,
Archive,
Boxes,
ChevronDown,
ChevronRight,
@ -69,11 +70,14 @@ export default function ProductsPage() {
setLoading(true);
setError(null);
try {
const normalizedSearch = search.trim();
const response = await apiClient.getCommerceProducts({
search: search.trim() || undefined,
search: normalizedSearch || undefined,
kind: kind || undefined,
ordering,
is_active: true,
// The normal catalog stays compact, but a deliberate search must also
// find archived source cards so users do not mistake them for missing.
is_active: normalizedSearch ? undefined : true,
page,
page_size: PAGE_SIZE,
});
@ -291,6 +295,11 @@ function ProductListItem({ product }: { product: CommerceProduct }) {
<span className="app-badge shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium">
{kindLabels[product.kind]}
</span>
{!product.is_active ? (
<span className="app-feedback-warning inline-flex shrink-0 items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium">
<Archive className="h-2.5 w-2.5" /> Архив
</span>
) : null}
</span>
<span className="app-text-muted mt-1 block truncate text-xs">
Артикул: {product.sku || "—"}