frontend


frontend / api/analytics/lowStock / getLowStockItems

Function: getLowStockItems()

getLowStockItems(supplierId, p?): Promise<LowStockRow[]>

Defined in: src/api/analytics/lowStock.ts:31

Fetch low-stock rows for a given supplier, optionally bounded by dates. Returns array of {itemName, quantity, minimumQuantity}. Empty array on errors.

Parameters

supplierId

string

p?

from?

string = ...

supplierId?

string = ...

to?

string = ...

Returns

Promise<LowStockRow[]>

Example

const lowStockItems = await getLowStockItems('SUP-001', {
 from: '2025-09-01',
to: '2025-11-30'
});
return <AlertTable data={lowStockItems} />;