changes
This commit is contained in:
1 parent
a99af426db
commit
8886aa8640
91 files changed
+2823
-773
No files matched your search
@@ -2,11 +2,11 @@ import { getTranslations } from "next-intl/server";
|
||||
import { SiteFooter } from "@/components/organisms/SiteFooter";
|
||||
import { SiteHeader } from "@/components/organisms/SiteHeader";
|
||||
import { buildCourseNavChildren } from "@/lib/course-nav";
|
||||
import { getCourses, listPublishedCourseTags } from "@/lib/data/courses";
|
||||
import { getCourses } from "@/lib/data/courses";
|
||||
import { listPublishedCourseTags } from "@/lib/data/taxonomy";
|
||||
import { getPrograms } from "@/lib/data/programs";
|
||||
import {
|
||||
courseNavParentTag,
|
||||
courseNavTagOrder,
|
||||
professionalNav,
|
||||
siteShortName,
|
||||
} from "@/lib/site-config";
|
||||
@@ -22,14 +22,13 @@ export default async function ProfessionalLayout({
|
||||
const year = new Date().getFullYear();
|
||||
let courses: Awaited<ReturnType<typeof getCourses>> = [];
|
||||
let programs: Awaited<ReturnType<typeof getPrograms>> = [];
|
||||
let courseTags: string[] = [...courseNavTagOrder];
|
||||
let navTags: Awaited<ReturnType<typeof listPublishedCourseTags>> = [];
|
||||
try {
|
||||
[courses, programs, courseTags] = await Promise.all([
|
||||
[courses, programs, navTags] = await Promise.all([
|
||||
getCourses(),
|
||||
getPrograms(),
|
||||
listPublishedCourseTags(),
|
||||
listPublishedCourseTags({ navOnly: true }),
|
||||
]);
|
||||
if (courseTags.length === 0) courseTags = [...courseNavTagOrder];
|
||||
} catch (err) {
|
||||
console.error("[professional/layout] CMS fetch failed:", err);
|
||||
}
|
||||
@@ -38,7 +37,7 @@ export default async function ProfessionalLayout({
|
||||
item.label === courseNavParentTag
|
||||
? {
|
||||
...item,
|
||||
children: buildCourseNavChildren(courseTags),
|
||||
children: buildCourseNavChildren(navTags),
|
||||
}
|
||||
: item,
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user