@@ -14,6 +14,7 @@ import {
|
||||
SITE_SETTINGS_LOGO_LIGHT_FIELD_KEY,
|
||||
updateSiteSettings,
|
||||
} from "@/lib/app-config";
|
||||
import { toInternalAdminPath } from "@/lib/admin-routing";
|
||||
import { PAGE_TITLE_TOKEN, type SiteSettings } from "@/lib/site-settings";
|
||||
import { clearAdminSessionCookie, isAdminAuthenticated } from "@/lib/admin-auth";
|
||||
import { replaceEntityMediaUsages } from "@/lib/media";
|
||||
@@ -27,7 +28,7 @@ import { prisma } from "@/lib/prisma";
|
||||
function ensureAdmin() {
|
||||
if (!isAdminAuthenticated()) {
|
||||
clearAdminSessionCookie();
|
||||
redirect("/root");
|
||||
redirect("/");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,8 +75,8 @@ async function cleanupCreatedMedia(assetIds: string[], uploadedPaths: string[])
|
||||
|
||||
async function revalidateSiteSettingsPages() {
|
||||
revalidatePath("/", "layout");
|
||||
revalidatePath("/root");
|
||||
revalidatePath("/root/site-settings");
|
||||
revalidatePath(toInternalAdminPath("/"));
|
||||
revalidatePath(toInternalAdminPath("/site-settings"));
|
||||
revalidatePath("/coming-soon");
|
||||
|
||||
const publicPaths = ["/", "/about", "/portfolio", "/contact", "/success", "/coming-soon"];
|
||||
@@ -277,7 +278,7 @@ export async function saveSiteSettingsAction(formData: FormData) {
|
||||
});
|
||||
|
||||
await revalidateSiteSettingsPages();
|
||||
redirect(withMessage("/root/site-settings", "success", "Einstellungen gespeichert."));
|
||||
redirect(withMessage("/site-settings", "success", "Einstellungen gespeichert."));
|
||||
} catch (error) {
|
||||
if (isRedirectError(error)) {
|
||||
throw error;
|
||||
@@ -290,6 +291,6 @@ export async function saveSiteSettingsAction(formData: FormData) {
|
||||
? error.message
|
||||
: "Einstellungen konnten nicht gespeichert werden.";
|
||||
|
||||
redirect(withMessage("/root/site-settings", "error", message));
|
||||
redirect(withMessage("/site-settings", "error", message));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user