feat: Allow notes to have empty or null titles by updating schema, API validation, and frontend forms.

This commit is contained in:
2025-12-31 01:35:36 +01:00
parent 93170d17dc
commit 064d2ae748
3 changed files with 48 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ use notes_domain::{Note, Tag};
/// Request to create a new note
#[derive(Debug, Deserialize, Validate)]
pub struct CreateNoteRequest {
#[validate(length(min = 1, max = 200, message = "Title must be 1-200 characters"))]
#[validate(length(max = 200, message = "Title must be at most 200 characters"))]
pub title: String,
#[serde(default)]
@@ -29,7 +29,7 @@ pub struct CreateNoteRequest {
/// Request to update an existing note (all fields optional)
#[derive(Debug, Deserialize, Validate)]
pub struct UpdateNoteRequest {
#[validate(length(min = 1, max = 200, message = "Title must be 1-200 characters"))]
#[validate(length(max = 200, message = "Title must be at most 200 characters"))]
pub title: Option<String>,
pub content: Option<String>,