@svadmin/core 0.36.1 → 0.36.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svadmin/core",
3
- "version": "0.36.1",
3
+ "version": "0.36.2",
4
4
  "author": "zuohuadong",
5
5
  "repository": {
6
6
  "type": "git",
@@ -638,10 +638,10 @@ export function useForm<
638
638
  });
639
639
  },
640
640
  onError: (error: unknown, _vars: unknown, context: unknown) => {
641
- const ctx = context as { previousQueries?: [unknown, unknown][] } | undefined;
641
+ const ctx = context as { previousQueries?: [readonly unknown[], unknown][] } | undefined;
642
642
  if (ctx?.previousQueries) {
643
643
  for (const [queryKey, data] of ctx.previousQueries) {
644
- queryClient.setQueryData(queryKey as string[], data);
644
+ queryClient.setQueryData(queryKey, data);
645
645
  }
646
646
  }
647
647
  if (error instanceof UndoError) return;
@@ -88,7 +88,7 @@ export function deepMerge(target: unknown, source: unknown): unknown {
88
88
  interface MutationContext {
89
89
  _svadmin_ctx?: boolean;
90
90
  userContext?: unknown;
91
- previousQueries?: [unknown, unknown][];
91
+ previousQueries?: [readonly unknown[], unknown][];
92
92
  }
93
93
 
94
94
  interface MutationCallbacks {
@@ -359,7 +359,7 @@ export function useUpdate<TData extends BaseRecord = BaseRecord, TError = HttpEr
359
359
  const ctx = context as MutationContext | undefined;
360
360
  if (ctx?.previousQueries) {
361
361
  for (const [queryKey, data] of ctx.previousQueries) {
362
- queryClient.setQueryData(queryKey as string[], data);
362
+ queryClient.setQueryData(queryKey, data);
363
363
  }
364
364
  }
365
365
  if (error instanceof UndoError) return;
@@ -540,7 +540,7 @@ export function useDelete<TData extends BaseRecord = BaseRecord, TError = HttpEr
540
540
  const ctx = context as MutationContext | undefined;
541
541
  if (ctx?.previousQueries) {
542
542
  for (const [queryKey, data] of ctx.previousQueries) {
543
- queryClient.setQueryData(queryKey as string[], data);
543
+ queryClient.setQueryData(queryKey, data);
544
544
  }
545
545
  }
546
546
  if (error instanceof UndoError) return;