feat: Allow notes to have empty or null titles by updating schema, API validation, and frontend forms.
This commit is contained in:
@@ -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>,
|
||||
|
||||
Reference in New Issue
Block a user