Skip to content

Build your personal knowledge base with Trilium Notes

chore(client/ts): port services/sync

Elian Dorane8d1fe4e8424
diff --git a/src/public/app/services/sync.js b/src/public/app/services/sync.ts
similarity index 73%
rename from src/public/app/services/sync.js
rename to src/public/app/services/sync.ts
index 181f049336..7c953fb84e 100644
--- a/src/public/app/services/sync.js
+++ b/src/public/app/services/sync.ts
@@ -2,8 +2,15 @@ import { t } from './i18n.js';
import server from './server.js';
import toastService from "./toast.js";
+// TODO: De-duplicate with server once we have a commons.
+interface SyncResult {
+ success: boolean;
+ message: string;
+ errorCode?: string;
+}
+
async function syncNow(ignoreNotConfigured = false) {
- const result = await server.post('sync/now');
+ const result = await server.post<SyncResult>('sync/now');
if (result.success) {
toastService.showMessage(t("sync.finished-successfully"));