get note name from api

This commit is contained in:
Ryan Peters 2023-07-28 20:19:59 +00:00
parent d73e065805
commit e89f9f74fe
2 changed files with 3 additions and 2 deletions

View File

@ -12,6 +12,6 @@ namespace BinaryDad.Notes.Controllers
this.noteService = noteService; this.noteService = noteService;
} }
public string Note() => noteService.Get(); public string Note(string noteName) => noteService.GetText(noteName);
} }
} }

View File

@ -54,10 +54,11 @@ $(function () {
$textarea.val(content); $textarea.val(content);
showToast('#update-indicator'); showToast('#update-indicator');
}); });
// update content after reconnected // update content after reconnected
connection.onreconnected(function() { connection.onreconnected(function() {
$.get('api/note', function(content) { $.get(`api/note?noteName=${noteName}`, function(content) {
$textarea.val(content); $textarea.val(content);
showToast('#update-indicator'); showToast('#update-indicator');
console.log('Refreshed after disconnect'); console.log('Refreshed after disconnect');