Enhance course management by adding 'featured' and 'sort_order' fields to the database schema and related components. Update course filtering and display logic to prioritize featured courses in the catalog. Modify admin interfaces for course creation and editing to include new fields, ensuring proper handling in both the frontend and backend. Update documentation to reflect these changes.

This commit is contained in:
smhk1376 committed 2026-10-22 13:23:43 +03:30
1 parent 1641edfd01
commit 4b84409ed7
43 files changed
+703 -155

No files matched your search

+2
View File
@@ -47,6 +47,8 @@ const COURSE_COLUMNS: Record<string, string> = {
bodyHtml: "body_html",
seoDescription: "seo_description",
published: "published",
featured: "featured",
sortOrder: "sort_order",
};
// PATCH /api/admin/courses/[id] — update course (admin only)
+4 -2
View File
@@ -65,8 +65,8 @@ export async function POST(request: NextRequest) {
`INSERT INTO courses
(id, slug, title, summary, duration_hours, format, price,
registration_url, poster_image_url, brochure_image_url, image_url,
lead_html, body_html, seo_description, published)
VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15)`,
lead_html, body_html, seo_description, published, featured, sort_order)
VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17)`,
[
id,
d.slug,
@@ -83,6 +83,8 @@ export async function POST(request: NextRequest) {
d.bodyHtml,
d.seoDescription,
d.published,
d.featured,
d.sortOrder,
],
);
await setCourseCategories(id, d.categoryIds ?? []);