Implement CreateNote

This commit is contained in:
Micheal Wilkinson
2026-03-17 21:01:18 +00:00
parent 2f035ee485
commit a3aa962d39

View File

@@ -15,5 +15,11 @@ func NewNoteRepository(store NoteStore) *NoteRepository {
} }
func (r *NoteRepository) CreateNote(content string) (models.Note, error) { func (r *NoteRepository) CreateNote(content string) (models.Note, error) {
return models.Note{}, fmt.Errorf("not implemented") if content == "" {
return models.Note{}, fmt.Errorf("content cannot be empty")
}
note := models.Note{
Content: content,
}
return r.store.SaveNote(note)
} }