chore(client/ts): port services/sync

This commit is contained in:
Elian Doran 2024-12-19 20:58:50 +02:00
parent 52d7e613ec
commit e8d1fe4e84
No known key found for this signature in database

View File

@ -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"));