feature: create post

This commit is contained in:
libertyoms
2025-04-22 08:50:55 +02:00
parent a8c6b5297b
commit 43f867cfe4
8 changed files with 518 additions and 12 deletions

View File

@ -48,16 +48,16 @@ const PostSchema = z.object({
});
export type CreatePostState = {
errors?: {
message: string | null;
errors: {
title?: string[];
slug?: string[];
content?: string[];
image?: string[]; // Changed from imageUrl
image?: string[];
tags?: string[];
excerpt?: string[];
_form?: string[];
};
message?: string | null;
// Add a field to hold previous input values
previousInput?: {
title?: string;
slug?: string;
@ -65,7 +65,6 @@ export type CreatePostState = {
excerpt?: string;
tags?: string;
published?: boolean;
// We don't repopulate the file input for security reasons
};
};