umwd-components 0.1.825 → 0.1.827

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ "use server";
2
+ /*
3
+ * UMWD-Components
4
+ * @copyright Jelle Paulus
5
+ * @license MIT
6
+ */
7
+
8
+ import { fetchData } from '../loaders.js';
9
+ import { getStrapiURL } from '../../../lib/utils.js';
10
+ import { unstable_noStore } from 'next/cache';
11
+
12
+ const baseUrl = getStrapiURL();
13
+ // this returns an stock oversight for a returned product
14
+ // it's different from regular stock as it counts iro's (incoming return orders)
15
+ async function getSingleReturnStock(documentId) {
16
+ unstable_noStore();
17
+ const url = new URL(`/api/products/getReturnStock/${documentId}`, baseUrl);
18
+ return await fetchData(url.href);
19
+ }
20
+
21
+ export { getSingleReturnStock };
@@ -155,6 +155,7 @@ export { createOpoAction } from './data/actions/e-commerce/opo/createOpoAction.j
155
155
  export { EditStockForm } from './components/e-commerce/products/EditStockForm.js';
156
156
  export { EditReturnStockForm } from './components/e-commerce/products/EditReturnStockForm.js';
157
157
  export { getSingleStock } from './data/loaders/e-commerce/getSingleStock.js';
158
+ export { getSingleReturnStock } from './data/loaders/e-commerce/getSingleReturnStock.js';
158
159
  export { default as CsvDownloader } from './components/common/csv/CsvDownloader.js';
159
160
  export { getProductModel } from './data/loaders/e-commerce/getProductModel.js';
160
161
  export { queryAllProducts } from './data/loaders/e-commerce/queryAllProducts.js';