@compill/admin 1.0.43 → 1.0.44

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/index.cjs.js CHANGED
@@ -836,11 +836,12 @@ function PageQueryStateContainerInner(_a) {
836
836
  children
837
837
  } = _a,
838
838
  props = __rest$1(_a, ["queryId", "api", "apiFn", "loadingStyles", "errorStyles", "children"]);
839
+ // @ts-ignore
839
840
  const {
840
841
  data,
841
842
  isLoading,
842
843
  isError
843
- } = apiFn == "get" ? api.useApiQuery(api$1.queryKey, api$1.get, queryId) : api.useApiQuery(api$1.queryKey, api$1.getAll);
844
+ } = apiFn == "getAll" ? api.useApiQuery(api$1.queryKey, api$1.getAll, props.apiParams) : api.useApiQuery(api$1.queryKey, api$1.get, queryId);
844
845
  const invalidate = api.useInvalidateQuery(api$1.queryKey, queryId);
845
846
  if (isLoading) return jsxRuntime.jsx(components.QueryLoadingState, Object.assign({
846
847
  w: "full",
package/index.esm.js CHANGED
@@ -827,11 +827,12 @@ function PageQueryStateContainerInner(_a) {
827
827
  children
828
828
  } = _a,
829
829
  props = __rest$1(_a, ["queryId", "api", "apiFn", "loadingStyles", "errorStyles", "children"]);
830
+ // @ts-ignore
830
831
  const {
831
832
  data,
832
833
  isLoading,
833
834
  isError
834
- } = apiFn == "get" ? useApiQuery(api.queryKey, api.get, queryId) : useApiQuery(api.queryKey, api.getAll);
835
+ } = apiFn == "getAll" ? useApiQuery(api.queryKey, api.getAll, props.apiParams) : useApiQuery(api.queryKey, api.get, queryId);
835
836
  const invalidate = useInvalidateQuery(api.queryKey, queryId);
836
837
  if (isLoading) return jsx(QueryLoadingState, Object.assign({
837
838
  w: "full",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compill/admin",
3
- "version": "1.0.43",
3
+ "version": "1.0.44",
4
4
  "module": "./index.esm.js",
5
5
  "main": "./index.cjs.js"
6
6
  }
@@ -12,6 +12,7 @@ type PageQueryContainerProps<T extends CRUD_MODEL> = Omit<ContainerProps, "child
12
12
  children: (data: T) => React.ReactElement;
13
13
  } | {
14
14
  apiFn: "getAll";
15
+ apiParams?: any;
15
16
  children: (data: T[]) => React.ReactElement;
16
17
  }));
17
18
  export declare const PageQueryStateContainer: <T extends CRUD_MODEL>(p: PageQueryContainerProps<T> & {