method renames

This commit is contained in:
Ryan Peters 2024-05-07 21:43:09 -04:00
parent aa3accb412
commit e5cb210df2
5 changed files with 8 additions and 8 deletions

View File

@ -11,6 +11,6 @@ namespace BinaryDad.Notes.Controllers
public ApiController(INoteService noteService) => this.noteService = noteService; public ApiController(INoteService noteService) => this.noteService = noteService;
[Route("note/{noteName}")] [Route("note/{noteName}")]
public string Note(string noteName) => noteService.GetText(noteName); public string Note(string noteName) => noteService.GetNote(noteName);
} }
} }

View File

@ -18,7 +18,7 @@ public class NoteController : Controller
var model = new ContentModel var model = new ContentModel
{ {
CurrentNote = noteName, CurrentNote = noteName,
Text = noteService.GetText(noteName), Text = noteService.GetNote(noteName),
NoteNames = noteService.GetNoteNames() NoteNames = noteService.GetNoteNames()
}; };

View File

@ -25,7 +25,7 @@ namespace BinaryDad.Notes
public async Task SaveNote(string content, string noteName) public async Task SaveNote(string content, string noteName)
{ {
noteService.SaveText(content, noteName); noteService.SaveNote(content, noteName);
// find all other connections except for the current one // find all other connections except for the current one
var clientConnections = NoteContext.ClientNotes var clientConnections = NoteContext.ClientNotes

View File

@ -16,7 +16,7 @@
} }
} }
public string GetText(string noteName) public string GetNote(string noteName)
{ {
CheckFile(noteName); CheckFile(noteName);
@ -30,7 +30,7 @@
.ToList(); .ToList();
} }
public void SaveText(string content, string noteName) public void SaveNote(string content, string noteName)
{ {
File.WriteAllText(GetFilePath(noteName), content); File.WriteAllText(GetFilePath(noteName), content);
} }
@ -51,7 +51,7 @@
{ {
Directory.CreateDirectory(folderPath); Directory.CreateDirectory(folderPath);
SaveText("Hi! Feel free to start typing. Everything will be saved soon after you are done typing.", noteName); SaveNote("Hi! Feel free to start typing. Everything will be saved soon after you are done typing.", noteName);
} }
} }

View File

@ -3,8 +3,8 @@
public interface INoteService public interface INoteService
{ {
ICollection<string> GetNoteNames(); ICollection<string> GetNoteNames();
string GetText(string noteName); string GetNote(string noteName);
void SaveText(string content, string noteName); void SaveNote(string content, string noteName);
void DeleteNote(string noteName); void DeleteNote(string noteName);
} }
} }