From 78f03c8be00e8f79d24aadcaddd5789566fea9b7 Mon Sep 17 00:00:00 2001 From: Erwan Guyader Date: Tue, 20 Jun 2023 16:25:13 +0200 Subject: [PATCH] feat: Add OAuth client last synced datetime update --- packages/cozy-stack-client/src/SettingsCollection.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/cozy-stack-client/src/SettingsCollection.js b/packages/cozy-stack-client/src/SettingsCollection.js index 1e92f651f4..f26fe91621 100644 --- a/packages/cozy-stack-client/src/SettingsCollection.js +++ b/packages/cozy-stack-client/src/SettingsCollection.js @@ -83,6 +83,13 @@ class SettingsCollection extends DocumentCollection { data: normalizeDoc(resp.data, this.doctype) } } + + /** + * Updates the current OAuth client's last synchronization date + */ + async updateLastSynced() { + return this.stackClient.fetchJSON('POST', '/settings/synchronized') + } } SettingsCollection.normalizeDoctype = DocumentCollection.normalizeDoctypeJsonApi