umwd-components 0.1.712 → 0.1.714
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.
- package/dist/node_modules/base64-js/index.js +1 -1
- package/dist/node_modules/ieee754/index.js +1 -1
- package/dist/src/data/loaders/e-commerce/getAllInvoices.js +1 -1
- package/dist/src/data/loaders/logistics/getTableIpos.js +1 -1
- package/dist/src/data/loaders/logistics/getTableVendors.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/data/loaders/e-commerce/getAllInvoices.d.ts +1 -2
- package/dist/types/data/loaders/logistics/getTableIpos.d.ts +8 -0
- package/dist/types/data/loaders/logistics/getTableVendors.d.ts +14 -1
- package/package.json +1 -1
- package/src/data/loaders/e-commerce/getAllInvoices.ts +1 -1
- package/src/data/loaders/logistics/getTableIpos.ts +9 -4
- package/src/data/loaders/logistics/getTableVendors.tsx +25 -5
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* INFO Fetch all Invoices
|
|
3
3
|
* used by the Invoices table in the admin panel
|
|
4
4
|
*/
|
|
5
|
-
declare function getAllInvoices(currentPage: number, rowsPerPage: number, order: "asc" | "desc", orderBy: string,
|
|
6
|
-
filters?: {
|
|
5
|
+
declare function getAllInvoices(currentPage: number, rowsPerPage: number, order: "asc" | "desc", orderBy: string, filters?: {
|
|
7
6
|
[key: string]: string;
|
|
8
7
|
}): Promise<any>;
|
|
9
8
|
export { getAllInvoices };
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* INFO Fetch all IPOs
|
|
3
3
|
* used by the IPOs table in the admin panel
|
|
4
|
+
* @param currentPage - The current page number for pagination
|
|
5
|
+
* @param rowsPerPage - The number of rows per page for pagination
|
|
6
|
+
* @param order - The order direction, either "asc" or "desc"
|
|
7
|
+
* @param orderBy - The field to order by, defaults to "id"
|
|
8
|
+
* @param is_archive - An array of booleans to filter by archived status, defaulting to only non-archived IPOs
|
|
9
|
+
* @param filters - An object containing additional filters to apply
|
|
10
|
+
* @return A promise that resolves to the fetched IPO data
|
|
11
|
+
* * @throws Will throw an error if the fetch fails
|
|
4
12
|
*/
|
|
5
13
|
declare function getTableIpos(currentPage: number, rowsPerPage: number, order: "asc" | "desc", orderBy: string, is_archive?: boolean[], // default to only non-archived OPOs
|
|
6
14
|
filters?: {
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* INFO Fetch all vendors
|
|
3
|
+
* used by the Vendors table in the admin panel
|
|
4
|
+
* @param currentPage - The current page number for pagination
|
|
5
|
+
* @param rowsPerPage - The number of rows per page for pagination
|
|
6
|
+
* @param order - The order direction, either "asc" or "desc"
|
|
7
|
+
* @param orderBy - The field to order by, defaults to "id"
|
|
8
|
+
* @return A promise that resolves to the fetched vendor data
|
|
9
|
+
* @throws Will throw an error if the fetch fails
|
|
10
|
+
* */
|
|
11
|
+
declare function getTableVendors(currentPage: number, rowsPerPage: number, order: "asc" | "desc", orderBy: string, filters?: {
|
|
12
|
+
[key: string]: string;
|
|
13
|
+
}): Promise<any>;
|
|
14
|
+
export { getTableVendors };
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ async function getAllInvoices(
|
|
|
17
17
|
rowsPerPage: number,
|
|
18
18
|
order: "asc" | "desc",
|
|
19
19
|
orderBy: string,
|
|
20
|
-
is_archive: boolean[] = [false], // default to only non-archived OPOs
|
|
20
|
+
// is_archive: boolean[] = [false], // default to only non-archived OPOs
|
|
21
21
|
filters: { [key: string]: string } = {}
|
|
22
22
|
) {
|
|
23
23
|
noStore();
|
|
@@ -12,7 +12,16 @@ const baseUrl = getStrapiURL();
|
|
|
12
12
|
/**
|
|
13
13
|
* INFO Fetch all IPOs
|
|
14
14
|
* used by the IPOs table in the admin panel
|
|
15
|
+
* @param currentPage - The current page number for pagination
|
|
16
|
+
* @param rowsPerPage - The number of rows per page for pagination
|
|
17
|
+
* @param order - The order direction, either "asc" or "desc"
|
|
18
|
+
* @param orderBy - The field to order by, defaults to "id"
|
|
19
|
+
* @param is_archive - An array of booleans to filter by archived status, defaulting to only non-archived IPOs
|
|
20
|
+
* @param filters - An object containing additional filters to apply
|
|
21
|
+
* @return A promise that resolves to the fetched IPO data
|
|
22
|
+
* * @throws Will throw an error if the fetch fails
|
|
15
23
|
*/
|
|
24
|
+
|
|
16
25
|
async function getTableIpos(
|
|
17
26
|
currentPage: number,
|
|
18
27
|
rowsPerPage: number,
|
|
@@ -23,10 +32,6 @@ async function getTableIpos(
|
|
|
23
32
|
) {
|
|
24
33
|
noStore();
|
|
25
34
|
|
|
26
|
-
const user = await getUserRole();
|
|
27
|
-
const role = user?.data?.role?.type;
|
|
28
|
-
const isEnduser = role === "enduser";
|
|
29
|
-
|
|
30
35
|
const url = new URL(`/api/ipos`, baseUrl);
|
|
31
36
|
|
|
32
37
|
const processedFilters = processFilters(filters);
|
|
@@ -4,23 +4,41 @@ import qs from "qs";
|
|
|
4
4
|
import { fetchData } from "../loaders";
|
|
5
5
|
import { getStrapiURL } from "../../../lib/utils";
|
|
6
6
|
import { unstable_noStore as noStore } from "next/cache";
|
|
7
|
-
|
|
8
|
-
// this is the get all product function for the backend, it should be universal so it also works on the frontend
|
|
9
|
-
// this function is based on get all orders which the frontenduser uses to get all orders in it's order table
|
|
7
|
+
import { processFilters } from "../../../lib/processFilters";
|
|
10
8
|
|
|
11
9
|
const baseUrl = getStrapiURL();
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
/**
|
|
12
|
+
* INFO Fetch all vendors
|
|
13
|
+
* used by the Vendors table in the admin panel
|
|
14
|
+
* @param currentPage - The current page number for pagination
|
|
15
|
+
* @param rowsPerPage - The number of rows per page for pagination
|
|
16
|
+
* @param order - The order direction, either "asc" or "desc"
|
|
17
|
+
* @param orderBy - The field to order by, defaults to "id"
|
|
18
|
+
* @return A promise that resolves to the fetched vendor data
|
|
19
|
+
* @throws Will throw an error if the fetch fails
|
|
20
|
+
* */
|
|
21
|
+
async function getTableVendors(
|
|
14
22
|
currentPage: number,
|
|
15
23
|
rowsPerPage: number,
|
|
16
24
|
order: "asc" | "desc",
|
|
17
|
-
orderBy: string
|
|
25
|
+
orderBy: string,
|
|
26
|
+
// is_archive: boolean[] = [false], // default to only non-archived OPOs
|
|
27
|
+
filters: { [key: string]: string } = {}
|
|
18
28
|
) {
|
|
19
29
|
noStore();
|
|
20
30
|
|
|
21
31
|
const url = new URL(`/api/vendor-profiles`, baseUrl);
|
|
22
32
|
|
|
33
|
+
const processedFilters = processFilters(filters);
|
|
34
|
+
|
|
23
35
|
url.search = qs.stringify({
|
|
36
|
+
filters: {
|
|
37
|
+
// is_archive: {
|
|
38
|
+
// $in: is_archive,
|
|
39
|
+
// },
|
|
40
|
+
...processedFilters,
|
|
41
|
+
},
|
|
24
42
|
sort: `${orderBy || "id"}:${order || "desc"}`,
|
|
25
43
|
populate: {
|
|
26
44
|
business_credentials: true,
|
|
@@ -33,3 +51,5 @@ export async function getTableVendors(
|
|
|
33
51
|
|
|
34
52
|
return await fetchData(url.href);
|
|
35
53
|
}
|
|
54
|
+
|
|
55
|
+
export { getTableVendors };
|