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:
smhk1376 committed 2026-10-28 14:04:17 +03:30
1 parent 4b84409ed7
commit 2858b9c746
106 files changed
+2516 -1004

No files matched your search

+11 -33
View File
@@ -8,17 +8,11 @@ import { fileURLToPath } from "node:url";
import pg from "pg";
import { courses } from "../src/lib/mock/courses.ts";
import { programs } from "../src/lib/mock/programs.ts";
import { events } from "../src/lib/mock/events.ts";
import { articles } from "../src/lib/mock/articles.ts";
import {
alumniStories,
campaignBanners,
faculty,
intersections,
legalPages,
stats,
testimonials,
} from "../src/lib/mock/site.ts";
import {
SEED_COURSE_CATEGORIES,
@@ -26,17 +20,11 @@ import {
} from "../src/lib/taxonomy.ts";
import {
alumniStoryToRow,
articleToRow,
campaignBannerToRow,
courseToRow,
eventToRow,
facultyMemberToRow,
intersectionTopicToRow,
legalPageToRow,
programToRow,
siteStatToRow,
testimonialToRow,
} from "../src/lib/db/mappers.ts";
if (!process.env.DATABASE_URL) {
@@ -156,29 +144,22 @@ async function main() {
}
results.push(["course_category_links", catLinks]);
results.push(["course_tag_links", tagLinks]);
await upsert("programs", programs.map(programToRow), [
"id", "slug", "title", "blurb", "group_key", "href", "tagline", "audience",
"duration_label", "format_label", "highlights", "body", "published",
]);
await upsert("events", events.map(eventToRow), [
"id", "title", "start_date", "end_date", "location", "href", "summary", "published",
]);
await upsert("articles", articles.map(articleToRow), [
"id", "title", "category", "excerpt", "image_url", "href", "featured",
"body", "published_at", "author", "published",
]);
await client.query(`DELETE FROM intersection_topics`);
await upsert("intersection_topics", intersections.map(intersectionTopicToRow), [
"id", "slug", "title", "description", "href", "image_url", "body", "highlights", "published",
]);
for (const table of [
"programs",
"events",
"articles",
"intersection_topics",
"alumni_stories",
"testimonials",
]) {
const deleted = await client.query(`DELETE FROM ${table}`);
results.push([`${table}_cleared`, deleted.rowCount]);
}
await upsert("faculty_members", faculty.map(facultyMemberToRow), [
"id", "name", "title", "focus", "bio", "image_url",
"email", "office", "phone", "department", "linkedin_url", "scholar_url",
"published",
]);
await upsert("alumni_stories", alumniStories.map(alumniStoryToRow), [
"id", "title", "excerpt", "name", "program", "image_url", "href", "published",
]);
await upsert("campaign_banners", campaignBanners.map(campaignBannerToRow), [
"id", "version", "text", "href", "cta", "published",
]);
@@ -188,9 +169,6 @@ async function main() {
await upsert("site_stats", stats.map(siteStatToRow), [
"id", "value", "label", "published",
]);
await upsert("testimonials", testimonials.map(testimonialToRow), [
"id", "quote", "name", "role", "course_title", "published",
]);
const counts = await client.query(`
SELECT (SELECT count(*) FROM courses) AS courses,