23 lines
601 B
JavaScript
Raw Normal View History

"use strict";
2017-10-29 11:22:41 -04:00
function syncNow() {
$.ajax({
url: baseApiUrl + 'sync/now',
type: 'POST',
success: result => {
if (result.success) {
2017-11-04 19:35:39 -04:00
status.checkStatus();
2017-11-08 22:33:08 -05:00
showMessage("Sync finished successfully.");
2017-10-29 11:22:41 -04:00
}
else {
if (result.message.length > 50) {
result.message = result.message.substr(0, 50);
}
2017-11-08 22:33:08 -05:00
showError("Sync failed: " + result.message);
2017-10-29 11:22:41 -04:00
}
},
2017-11-08 22:33:08 -05:00
error: () => showError("Sync failed for unknown reason.")
2017-10-29 11:22:41 -04:00
});
}