From 538ddeeb4f40ddf88f25add1e186e93ffb3df6b8 Mon Sep 17 00:00:00 2001 From: Ryan Peters Date: Thu, 9 Jan 2025 11:41:18 -0500 Subject: [PATCH] adjusted save note argument signature --- NoteHub.cs | 4 ++-- Services/FileNoteService.cs | 2 +- Services/INoteService.cs | 2 +- wwwroot/js/site.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NoteHub.cs b/NoteHub.cs index 337ed78..4162fc6 100644 --- a/NoteHub.cs +++ b/NoteHub.cs @@ -25,11 +25,11 @@ namespace BinaryDad.Notes return base.OnConnectedAsync(); } - public async Task SaveNote(string content, string noteName) + public async Task SaveNote(string noteName, string content) { try { - noteService.SaveNote(content, noteName); + noteService.SaveNote(noteName, content); // find all other connections except for the current one var clientConnections = NoteContext.ClientNotes diff --git a/Services/FileNoteService.cs b/Services/FileNoteService.cs index 6e6b0f8..02048a0 100644 --- a/Services/FileNoteService.cs +++ b/Services/FileNoteService.cs @@ -30,7 +30,7 @@ .ToList(); } - public void SaveNote(string content, string noteName) + public void SaveNote(string noteName, string content) { File.WriteAllText(GetFilePath(noteName), content); } diff --git a/Services/INoteService.cs b/Services/INoteService.cs index eef389b..efd5717 100644 --- a/Services/INoteService.cs +++ b/Services/INoteService.cs @@ -4,7 +4,7 @@ { ICollection GetNoteNames(); string GetNote(string noteName); - void SaveNote(string content, string noteName); + void SaveNote(string noteName, string content); void DeleteNote(string noteName); } } diff --git a/wwwroot/js/site.js b/wwwroot/js/site.js index a7092fa..33b51c3 100644 --- a/wwwroot/js/site.js +++ b/wwwroot/js/site.js @@ -29,7 +29,7 @@ function saveContent($textarea) { var content = $textarea.val(); - connection.invoke('SaveNote', content, noteName).then(function () { + connection.invoke('SaveNote', noteName, content).then(function () { showToast('#saved-indicator'); }).catch(function (err) { console.error(err.toString());