feat(core-cms): compose @repo/blog/cms into payload config

This commit is contained in:
2026-05-04 22:29:50 +02:00
parent 1d59698ebe
commit a92341fb74
9 changed files with 93 additions and 24 deletions

View File

@@ -10,7 +10,7 @@ import { createArticleUseCase } from "@/application/use-cases/create-article.use
const createInputSchema = z.object({
title: z.string().min(1).max(255),
content: z.unknown(),
content: z.unknown().optional(),
authorId: z.string(),
slug: z.string().optional(),
});
@@ -35,7 +35,12 @@ export async function createArticleController(
cause: parsed.error,
});
}
return createArticleUseCase(parsed.data);
return createArticleUseCase({
title: parsed.data.title,
content: parsed.data.content ?? null,
authorId: parsed.data.authorId,
slug: parsed.data.slug,
});
}
export async function getArticlesController(