Add delete view

This commit is contained in:
Maximilian Friedersdorff 2025-06-18 21:40:42 +01:00
parent cb6c12354a
commit e2c59d5f28
3 changed files with 26 additions and 5 deletions

View file

@ -58,3 +58,8 @@ func LoadNote(title string) (*Note, error) {
}
return &Note{Title: title, Body: body}, nil
}
func DeleteNote(title string) error {
filename := filepath.Join(conf.Conf.NotesDir, fmtPath(title))
return os.Remove(filename)
}