mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 10:55:55 +01:00
using server.method() instead of direct call to $.ajax - preparation for electron without network requests
This commit is contained in:
@@ -30,16 +30,9 @@ const editTreePrefix = (function() {
|
||||
formEl.submit(() => {
|
||||
const prefix = treePrefixInputEl.val();
|
||||
|
||||
$.ajax({
|
||||
url: baseApiUrl + 'tree/' + noteTreeId + '/setPrefix',
|
||||
type: 'PUT',
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify({
|
||||
prefix: prefix
|
||||
}),
|
||||
success: () => noteTree.setPrefix(noteTreeId, prefix),
|
||||
error: () => showError("Error setting prefix.")
|
||||
});
|
||||
server.put('tree/' + noteTreeId + '/setPrefix', {
|
||||
prefix: prefix
|
||||
}).then(() => noteTree.setPrefix(noteTreeId, prefix));
|
||||
|
||||
dialogEl.dialog("close");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user