mirror of
https://github.com/OHTU-German-learning-website/OHTU-German-learning-website.git
synced 2026-10-12 19:13:51 +03:00
fix a functional bug
This commit is contained in:
@@ -107,7 +107,18 @@ export const PUT = withAuth(
|
||||
try {
|
||||
newData = await getPageData(type, slug);
|
||||
} catch {
|
||||
return new NextResponse("not found", { status: 404 });
|
||||
if (type !== "grammar") {
|
||||
return new NextResponse("not found", { status: 404 });
|
||||
}
|
||||
|
||||
newData = {
|
||||
title: "",
|
||||
description: null,
|
||||
content: "",
|
||||
page_order: null,
|
||||
slug,
|
||||
page_group: type,
|
||||
};
|
||||
}
|
||||
if (data.title) newData.title = data.title;
|
||||
if (data.page_order) newData.page_order = data.page_order;
|
||||
|
||||
Reference in New Issue
Block a user