Add duplicate detection for new articles and import a new blog post

Implement duplicate slug checking before article creation and add the "Folx Stadl – Sendung 21" article with its content and embed.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 413891e8-d784-4bea-b9f5-91a5a68316b4
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 196c1db7-32c2-4384-81d2-0e7348b04b59
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/413891e8-d784-4bea-b9f5-91a5a68316b4/kmpcO4B
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
sebastjanartic 2026-02-28 17:22:10 +00:00
parent db5ec8b74c
commit dc99ca0dfc
3 changed files with 5 additions and 0 deletions

View File

@ -16,6 +16,7 @@ PORT = "5000"
deploymentTarget = "autoscale"
run = ["node", "./dist/index.cjs"]
build = ["npm", "run", "build"]
publicDir = "dist/public"
[workflows]
runButton = "Project"

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

View File

@ -71,6 +71,10 @@ export async function registerRoutes(
if (!parsed.success) {
return res.status(400).json({ message: "Invalid article data", errors: parsed.error.flatten() });
}
const existing = await storage.getArticleBySlug(parsed.data.slug);
if (existing) {
return res.status(409).json({ message: `Artikel "${existing.title}" existiert bereits (ID: ${existing.id})` });
}
const article = await storage.createArticle(parsed.data);
res.status(201).json(article);
});