diff --git a/Controllers/ApiController.cs b/Controllers/ApiController.cs index 2112ea0..54a5c03 100644 --- a/Controllers/ApiController.cs +++ b/Controllers/ApiController.cs @@ -12,6 +12,6 @@ namespace BinaryDad.Notes.Controllers this.noteService = noteService; } - public string Note() => noteService.Get(); + public string Note(string noteName) => noteService.GetText(noteName); } } diff --git a/wwwroot/js/site.js b/wwwroot/js/site.js index 62482a4..18182aa 100644 --- a/wwwroot/js/site.js +++ b/wwwroot/js/site.js @@ -54,10 +54,11 @@ $(function () { $textarea.val(content); showToast('#update-indicator'); }); + // update content after reconnected connection.onreconnected(function() { - $.get('api/note', function(content) { + $.get(`api/note?noteName=${noteName}`, function(content) { $textarea.val(content); showToast('#update-indicator'); console.log('Refreshed after disconnect');