adjusted save note argument signature

This commit is contained in:
Ryan Peters 2025-01-09 11:41:18 -05:00
parent 9a5a082f6d
commit 538ddeeb4f
4 changed files with 5 additions and 5 deletions

View File

@ -25,11 +25,11 @@ namespace BinaryDad.Notes
return base.OnConnectedAsync(); return base.OnConnectedAsync();
} }
public async Task SaveNote(string content, string noteName) public async Task SaveNote(string noteName, string content)
{ {
try try
{ {
noteService.SaveNote(content, noteName); noteService.SaveNote(noteName, content);
// 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

@ -30,7 +30,7 @@
.ToList(); .ToList();
} }
public void SaveNote(string content, string noteName) public void SaveNote(string noteName, string content)
{ {
File.WriteAllText(GetFilePath(noteName), content); File.WriteAllText(GetFilePath(noteName), content);
} }

View File

@ -4,7 +4,7 @@
{ {
ICollection<string> GetNoteNames(); ICollection<string> GetNoteNames();
string GetNote(string noteName); string GetNote(string noteName);
void SaveNote(string content, string noteName); void SaveNote(string noteName, string content);
void DeleteNote(string noteName); void DeleteNote(string noteName);
} }
} }

View File

@ -29,7 +29,7 @@ function saveContent($textarea) {
var content = $textarea.val(); var content = $textarea.val();
connection.invoke('SaveNote', content, noteName).then(function () { connection.invoke('SaveNote', noteName, content).then(function () {
showToast('#saved-indicator'); showToast('#saved-indicator');
}).catch(function (err) { }).catch(function (err) {
console.error(err.toString()); console.error(err.toString());