moved services into the service directory

This commit is contained in:
azivner
2018-03-25 13:02:39 -04:00
parent f52d7e3c28
commit fddd1c278f
33 changed files with 91 additions and 92 deletions

View File

@@ -0,0 +1,31 @@
"use strict";
import utils from './utils.js';
async function syncNow() {
const result = await server.post('sync/now');
if (result.success) {
utils.showMessage("Sync finished successfully.");
}
else {
if (result.message.length > 50) {
result.message = result.message.substr(0, 50);
}
utils.showError("Sync failed: " + result.message);
}
}
$("#sync-now-button").click(syncNow);
async function forceNoteSync(noteId) {
const result = await server.post('sync/force-note-sync/' + noteId);
utils.showMessage("Note added to sync queue.");
}
export default {
syncNow,
forceNoteSync
};