From e8d1fe4e842419c4a43694b1cf1fe1b385293912 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 19 Dec 2024 20:58:50 +0200 Subject: [PATCH] chore(client/ts): port services/sync --- src/public/app/services/{sync.js => sync.ts} | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) rename src/public/app/services/{sync.js => sync.ts} (73%) 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 181f04933..7c953fb84 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('sync/now'); if (result.success) { toastService.showMessage(t("sync.finished-successfully"));