mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-19 02:10:04 +08:00
chore(client/ts): port services/sync
This commit is contained in:
parent
52d7e613ec
commit
e8d1fe4e84
@ -2,8 +2,15 @@ import { t } from './i18n.js';
|
|||||||
import server from './server.js';
|
import server from './server.js';
|
||||||
import toastService from "./toast.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) {
|
async function syncNow(ignoreNotConfigured = false) {
|
||||||
const result = await server.post('sync/now');
|
const result = await server.post<SyncResult>('sync/now');
|
||||||
|
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
toastService.showMessage(t("sync.finished-successfully"));
|
toastService.showMessage(t("sync.finished-successfully"));
|
Loading…
x
Reference in New Issue
Block a user