1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00

(bug) product stock status

This commit is contained in:
Du Peng 2022-09-28 11:32:07 +02:00
parent ac671ea26d
commit c7559e3857

View File

@ -66,7 +66,7 @@ export const StoreProductItem: React.FC<StoreProductItemProps> = ({ product, car
* Return product's stock status
*/
const productStockStatus = (product: Product) => {
if (product.stock.external === 0) {
if (product.stock.external < (product.quantity_min || 1)) {
return <span>{t('app.public.store_product_item.out_of_stock')}</span>;
}
if (product.low_stock_threshold && product.stock.external < product.low_stock_threshold) {