Remove unused redirects from the Next.js configuration and update package dependencies to include new Tiptap extensions for enhanced text editing capabilities. Clean up the database seeding script by removing commented-out code and ensuring proper deletion of obsolete entries. Update various pages to handle not found scenarios gracefully, improving user experience across the application.
This commit is contained in:
1 parent
4b84409ed7
commit
2858b9c746
106 files changed
+2516
-1004
No files matched your search
@@ -15,6 +15,22 @@ const catalogOrderSql = `CASE WHEN ${isArchiveCourseSql} THEN 1 ELSE 0 END ASC,
|
||||
c.sort_order ASC,
|
||||
c.title ASC`;
|
||||
|
||||
/** Published course URLs for the sitemap, including archived offerings. */
|
||||
export async function getCoursesForSitemap(): Promise<
|
||||
{ slug: string; updatedAt: Date }[]
|
||||
> {
|
||||
const res = await query<{ slug: string; updated_at: Date }>(
|
||||
`SELECT c.slug, c.updated_at
|
||||
FROM courses c
|
||||
WHERE c.published = true AND c.slug <> ''
|
||||
ORDER BY c.updated_at DESC`,
|
||||
);
|
||||
return res.rows.map((row) => ({
|
||||
slug: row.slug,
|
||||
updatedAt: row.updated_at,
|
||||
}));
|
||||
}
|
||||
|
||||
export async function getCourses(): Promise<Course[]> {
|
||||
const res = await query<CourseRow>(
|
||||
`${COURSE_WITH_TAXONOMY_SELECT}
|
||||
|
||||
Reference in new issue
Block a user