|
|
@@ -160,13 +160,29 @@ async function fetchInventoriesImpl(data: SearchInventory) { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async function fetchInventoriesLatestImpl(data: SearchInventory) { |
|
|
|
|
|
const queryStr = convertObjToURLSearchParams(data); |
|
|
|
|
|
return serverFetchJson<InventoryResultByPage>( |
|
|
|
|
|
`${BASE_API_URL}/inventory/searchLatest/getRecordByPage?${queryStr}`, |
|
|
|
|
|
{ next: { tags: ["inventories"] } }, |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
export const fetchInventories = cache(fetchInventoriesImpl); |
|
|
export const fetchInventories = cache(fetchInventoriesImpl); |
|
|
|
|
|
|
|
|
|
|
|
/** Inventory search page: latest inventory row per item (no baseUnit/uomId filter). */ |
|
|
|
|
|
export const fetchInventoriesLatest = cache(fetchInventoriesLatestImpl); |
|
|
|
|
|
|
|
|
/** Bypass React cache() after mutations so lists show fresh qty. */ |
|
|
/** Bypass React cache() after mutations so lists show fresh qty. */ |
|
|
export async function fetchInventoriesFresh(data: SearchInventory) { |
|
|
export async function fetchInventoriesFresh(data: SearchInventory) { |
|
|
return fetchInventoriesImpl(data); |
|
|
return fetchInventoriesImpl(data); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** Bypass React cache() for inventory search page latest-inventory search. */ |
|
|
|
|
|
export async function fetchInventoriesLatestFresh(data: SearchInventory) { |
|
|
|
|
|
return fetchInventoriesLatestImpl(data); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
async function fetchInventoryLotLinesImpl(data: SearchInventoryLotLine) { |
|
|
async function fetchInventoryLotLinesImpl(data: SearchInventoryLotLine) { |
|
|
const queryStr = convertObjToURLSearchParams(data); |
|
|
const queryStr = convertObjToURLSearchParams(data); |
|
|
return serverFetchJson<InventoryLotLineResultByPage>( |
|
|
return serverFetchJson<InventoryLotLineResultByPage>( |
|
|
|