add delete endpoint

This commit is contained in:
2023-05-12 12:47:54 -04:00
parent b60a246c34
commit faaa0dba8f
3 changed files with 16 additions and 0 deletions

View File

@ -32,6 +32,13 @@
File.WriteAllText(GetFilePath(noteName), content);
}
public void DeleteNote(string noteName)
{
var filePath = GetFilePath(noteName);
File.Delete(filePath);
}
private void CheckFile(string noteName)
{
var filePath = GetFilePath(noteName);

View File

@ -5,5 +5,6 @@
ICollection<string> GetNoteNames();
string GetText(string? noteName);
void SaveText(string content, string? noteName);
void DeleteNote(string noteName);
}
}