Add grouped stock view with expiration and location filtering
This commit is contained in:
+15
-2
@@ -9,9 +9,9 @@ export async function searchItemDefinitions(store, query) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const payload = await apiRequest(store, getPath('items'), {
|
||||
const payload = await apiRequest(store, `${getPath('items')}/grouped`, {
|
||||
includeKitchen: false,
|
||||
query: { search_name: query },
|
||||
query: { search_name: query, expanded: 0 },
|
||||
});
|
||||
|
||||
if (Array.isArray(payload)) {
|
||||
@@ -33,6 +33,19 @@ export async function listStockEntries(store, filters = {}) {
|
||||
return payload?.data || payload?.entries || payload?.items || [];
|
||||
}
|
||||
|
||||
export async function listGroupedStockEntries(store) {
|
||||
const payload = await apiRequest(store, `${getPath('items')}/grouped`, {
|
||||
includeKitchen: false,
|
||||
query: { expanded: 1 },
|
||||
});
|
||||
|
||||
if (Array.isArray(payload)) {
|
||||
return payload;
|
||||
}
|
||||
|
||||
return payload?.data || payload?.entries || payload?.items || payload?.groups || [];
|
||||
}
|
||||
|
||||
export async function getStockEntry(store, stockId) {
|
||||
const payload = await apiRequest(store, `${getPath('items')}/${stockId}`, {
|
||||
includeKitchen: false,
|
||||
|
||||
Reference in New Issue
Block a user