Add Sonner-based notifications and UX polish
This commit is contained in:
@@ -21,7 +21,10 @@ export async function updateMaintenanceModeAction(formData: FormData) {
|
||||
const nextValue = formData.get("enabled") === "true";
|
||||
const redirectPath = String(formData.get("redirectPath") ?? "/root");
|
||||
const redirectUrl = new URL(redirectPath, "http://localhost");
|
||||
redirectUrl.searchParams.set("__saved", "maintenance");
|
||||
redirectUrl.searchParams.set(
|
||||
"success",
|
||||
nextValue ? "Wartungsmodus aktiviert." : "Wartungsmodus deaktiviert.",
|
||||
);
|
||||
|
||||
await setMaintenanceMode(nextValue);
|
||||
revalidatePath("/", "layout");
|
||||
|
||||
Reference in New Issue
Block a user