consistent usage of arrow syntax instead of anonymous functions

This commit is contained in:
azivner
2017-10-09 18:53:11 -04:00
parent 49460dfb8a
commit ca87ff9215
15 changed files with 76 additions and 95 deletions

View File

@@ -3,7 +3,7 @@ function convertNoteToHtml(noteId, failedNotes) {
url: baseApiUrl + 'notes/' + noteId,
type: 'GET',
async: false,
success: function (note) {
success: note => {
const noteNode = getNodeByKey(noteId);
if (noteNode.data.is_clone) {
@@ -23,34 +23,20 @@ function convertNoteToHtml(noteId, failedNotes) {
data: JSON.stringify(note),
contentType: "application/json",
async: false,
success: function () {
success: () => {
console.log("Note " + noteId + " converted.")
},
error: function () {
error: () => {
console.log("Note " + noteId + " failed when writing");
failedNotes.push(noteId);
}
});
},
error: function () {
error: () => {
console.log("Note " + noteId + " failed when reading");
failedNotes.push(noteId);
}
});
}
function convertAll2Html() {
const failedNotes = [];
let counter = 1;
for (const noteId of globalAllNoteIds) {
console.log('Converting ' + counter + "/" + globalAllNoteIds.length);
counter++;
convertNoteToHtml(noteId, failedNotes);
}
console.log("Failed notes: ", failedNotes);
}