feat: ensure numeric conversion for stock values in ProductCardRow component

This commit is contained in:
Yoga Pangestu 2026-08-14 14:46:57 +07:00
parent 4d22d85851
commit f6503ace2b

View File

@ -63,9 +63,9 @@ export function ProductCardRow({
const { can, hasRole } = useCan();
const isVerifier = hasRole('developer') || hasRole('owner');
const variantCount = product.variants_count ?? 0;
const totalStock = product.total_stock ?? 0;
const totalReject = product.total_reject_stock ?? 0;
const totalRetail = product.total_retail_stock ?? 0;
const totalStock = Number(product.total_stock ?? 0);
const totalReject = Number(product.total_reject_stock ?? 0);
const totalRetail = Number(product.total_retail_stock ?? 0);
const totalAll = totalStock + totalReject + totalRetail;
const isPending = product.status === 'pending';