Skip to content

Commit 10ef356

Browse files
committed
feat: Add OAuth client last synced datetime update
1 parent 445e673 commit 10ef356

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

docs/api/cozy-stack-client.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,6 +1658,7 @@ Implements `DocumentCollection` API to interact with the /settings endpoint of t
16581658
* [SettingsCollection](#SettingsCollection)
16591659
* [.get(id)](#SettingsCollection+get) ⇒ <code>object</code>
16601660
* [.update(document)](#SettingsCollection+update)
1661+
* [.updateLastSynced()](#SettingsCollection+updateLastSynced)
16611662

16621663
<a name="SettingsCollection+get"></a>
16631664

@@ -1682,6 +1683,12 @@ Updates a settings document
16821683
| --- | --- | --- |
16831684
| document | <code>object</code> | Document to update. Do not forget the _id attribute |
16841685

1686+
<a name="SettingsCollection+updateLastSynced"></a>
1687+
1688+
### settingsCollection.updateLastSynced()
1689+
Updates the current OAuth client's last synchronization date
1690+
1691+
**Kind**: instance method of [<code>SettingsCollection</code>](#SettingsCollection)
16851692
<a name="SharingCollection"></a>
16861693

16871694
## SharingCollection

packages/cozy-stack-client/src/SettingsCollection.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ class SettingsCollection extends DocumentCollection {
8383
data: normalizeDoc(resp.data, this.doctype)
8484
}
8585
}
86+
87+
/**
88+
* Updates the current OAuth client's last synchronization date
89+
*/
90+
async updateLastSynced() {
91+
return this.stackClient.fetchJSON('POST', '/settings/synchronized')
92+
}
8693
}
8794

8895
SettingsCollection.normalizeDoctype = DocumentCollection.normalizeDoctypeJsonApi

0 commit comments

Comments
 (0)