@compill/admin 1.0.74 → 1.0.75

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
@@ -2261,6 +2261,7 @@ function ItemDeleteDialog(_a) {
2261
2261
  itemLabel,
2262
2262
  queryId = "",
2263
2263
  api: api$1,
2264
+ apiFn,
2264
2265
  invalidateQueriesOnSuccess = true,
2265
2266
  invalidateQueryKey,
2266
2267
  size = "lg",
@@ -2269,8 +2270,9 @@ function ItemDeleteDialog(_a) {
2269
2270
  show,
2270
2271
  onClose
2271
2272
  } = _a,
2272
- props = __rest$1(_a, ["itemLabel", "queryId", "api", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "md_boxSizing", "msg", "show", "onClose"]);
2273
- const mutation = invalidateQueriesOnSuccess ? api.useInvalidateParentMutation(api$1.delete, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey) : api.useApiMutation(api$1.delete, api$1.queryKey);
2273
+ props = __rest$1(_a, ["itemLabel", "queryId", "api", "apiFn", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "md_boxSizing", "msg", "show", "onClose"]);
2274
+ const fn = apiFn ? api$1[apiFn] : api$1.delete;
2275
+ const mutation = invalidateQueriesOnSuccess ? api.useInvalidateParentMutation(fn, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api$1.queryKey) : api.useApiMutation(fn, api$1.queryKey);
2274
2276
  const mutate = api.useMutate(mutation, {
2275
2277
  onSuccess: () => onClose === null || onClose === void 0 ? void 0 : onClose()
2276
2278
  });
package/index.esm.js CHANGED
@@ -2251,6 +2251,7 @@ function ItemDeleteDialog(_a) {
2251
2251
  itemLabel,
2252
2252
  queryId = "",
2253
2253
  api,
2254
+ apiFn,
2254
2255
  invalidateQueriesOnSuccess = true,
2255
2256
  invalidateQueryKey,
2256
2257
  size = "lg",
@@ -2259,8 +2260,9 @@ function ItemDeleteDialog(_a) {
2259
2260
  show,
2260
2261
  onClose
2261
2262
  } = _a,
2262
- props = __rest$1(_a, ["itemLabel", "queryId", "api", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "md_boxSizing", "msg", "show", "onClose"]);
2263
- const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(api.delete, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey) : useApiMutation(api.delete, api.queryKey);
2263
+ props = __rest$1(_a, ["itemLabel", "queryId", "api", "apiFn", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "md_boxSizing", "msg", "show", "onClose"]);
2264
+ const fn = apiFn ? api[apiFn] : api.delete;
2265
+ const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(fn, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey) : useApiMutation(fn, api.queryKey);
2264
2266
  const mutate = useMutate(mutation, {
2265
2267
  onSuccess: () => onClose === null || onClose === void 0 ? void 0 : onClose()
2266
2268
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compill/admin",
3
- "version": "1.0.74",
3
+ "version": "1.0.75",
4
4
  "module": "./index.esm.js",
5
5
  "main": "./index.cjs.js"
6
6
  }
@@ -5,8 +5,9 @@ export interface ItemDeleteDialogProps extends ModalProps {
5
5
  itemLabel: string;
6
6
  queryId: string;
7
7
  api: CRUDAPI<any>;
8
+ apiFn?: string;
8
9
  invalidateQueriesOnSuccess?: boolean;
9
10
  invalidateQueryKey?: string[];
10
11
  msg?: (itemLabel: string) => string | React.ReactNode;
11
12
  }
12
- export declare function ItemDeleteDialog({ itemLabel, queryId, api, invalidateQueriesOnSuccess, invalidateQueryKey, size, md_boxSizing, msg, show, onClose, ...props }: ItemDeleteDialogProps): JSX.Element;
13
+ export declare function ItemDeleteDialog({ itemLabel, queryId, api, apiFn, invalidateQueriesOnSuccess, invalidateQueryKey, size, md_boxSizing, msg, show, onClose, ...props }: ItemDeleteDialogProps): JSX.Element;