umwd-components 0.1.690 → 0.1.691

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.
@@ -1 +1,5 @@
1
- export declare function getPaginatedCategories(currentPage?: number, rowsPerPage?: number, order?: "asc" | "desc", orderBy?: string, is_archive?: boolean[]): Promise<any>;
1
+ export declare function getPaginatedCategories(currentPage?: number, // default to page 0
2
+ rowsPerPage?: number, // default to 4 rows per page
3
+ order?: "asc" | "desc", // default to descending order
4
+ orderBy?: string, // default to ordering by id
5
+ is_archive?: boolean[]): Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umwd-components",
3
- "version": "0.1.690",
3
+ "version": "0.1.691",
4
4
  "description": "UMWD Component library",
5
5
  "main": "dist/src/index.js",
6
6
  "module": "dist/src/index.js",
@@ -7,10 +7,10 @@ import { getStrapiURL } from "../../../lib/utils";
7
7
  const baseUrl = getStrapiURL();
8
8
 
9
9
  export async function getPaginatedCategories(
10
- currentPage?: number,
11
- rowsPerPage?: number,
12
- order?: "asc" | "desc",
13
- orderBy?: string,
10
+ currentPage: number = 0, // default to page 0
11
+ rowsPerPage: number = 4, // default to 4 rows per page
12
+ order: "asc" | "desc" = "desc", // default to descending order
13
+ orderBy: string = "id", // default to ordering by id
14
14
  is_archive: boolean[] = [false] // default to both archived and non-archived categories
15
15
  ) {
16
16
  const url = new URL(`/api/product-categories`, baseUrl);
@@ -26,9 +26,7 @@ export async function getPaginatedCategories(
26
26
 
27
27
  url.search = qs.stringify({
28
28
  filters: {
29
- is_archive: {
30
- $in: is_archive,
31
- },
29
+ is_archive: false, // always filter out archived categories
32
30
  },
33
31
  populate: {
34
32
  products: {