@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
package/src/form-hooks.svelte.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
543
|
+
queryClient.setQueryData(queryKey, data);
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
546
|
if (error instanceof UndoError) return;
|