Harden catalog admin: fix translate/quick-add, RCON sync, and confirm UX.
Local Build and Deploy / deploy (push) Successful in 1m18s
Local Build and Deploy / deploy (push) Successful in 1m18s
Restore broken Quick Add search, correct Translate saves to items_base and FurnitureData, reparent page deletes, sync RCON on create/toggle/BC mutations, and replace native confirms/prompts with dialogs. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
de9f837da1
commit
b52e25578d
20 files changed
+557
-216
No files matched your search
@@ -17,6 +17,8 @@ interface RunOptions {
|
||||
redirectTo?: string;
|
||||
/** Called on success with the result data. Overrides default router.refresh(). */
|
||||
onSuccess?: (data: Record<string, unknown>) => void;
|
||||
/** Called when the action fails or throws */
|
||||
onError?: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -42,6 +44,7 @@ export function useServerAction(options: UseServerActionOptions = {}) {
|
||||
errorMessage = "An error occurred.",
|
||||
redirectTo,
|
||||
onSuccess,
|
||||
onError,
|
||||
} = opts;
|
||||
|
||||
startTransition(async () => {
|
||||
@@ -59,10 +62,12 @@ export function useServerAction(options: UseServerActionOptions = {}) {
|
||||
}
|
||||
} else {
|
||||
toast.error(result.error || errorMessage);
|
||||
onError?.();
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("[useServerAction] Unexpected error:", err);
|
||||
toast.error(errorMessage);
|
||||
onError?.();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user