diff --git a/.replit b/.replit index 5cca7a0..0f55809 100644 --- a/.replit +++ b/.replit @@ -16,6 +16,7 @@ PORT = "5000" deploymentTarget = "autoscale" run = ["node", "./dist/index.cjs"] build = ["npm", "run", "build"] +publicDir = "dist/public" [workflows] runButton = "Project" diff --git a/client/public/uploads/folx-stadl-21.jpg b/client/public/uploads/folx-stadl-21.jpg new file mode 100644 index 0000000..047145b Binary files /dev/null and b/client/public/uploads/folx-stadl-21.jpg differ diff --git a/server/routes.ts b/server/routes.ts index 168e10b..1f7407f 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -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); });