Skip to content

Commit

Permalink
feat: Add OAuth client last synced datetime update
Browse files Browse the repository at this point in the history
  • Loading branch information
taratatach committed Feb 3, 2025
1 parent e74421c commit 0dcd553
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/api/cozy-stack-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -1827,6 +1827,7 @@ Implements `DocumentCollection` API to interact with the /settings endpoint of t
* [SettingsCollection](#SettingsCollection)
* [.get(id)](#SettingsCollection+get) ⇒ <code>object</code>
* [.update(document)](#SettingsCollection+update)
* [.updateLastSynced()](#SettingsCollection+updateLastSynced)

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

Expand All @@ -1851,6 +1852,12 @@ Updates a settings document
| --- | --- | --- |
| document | <code>object</code> | Document to update. Do not forget the _id attribute |

<a name="SettingsCollection+updateLastSynced"></a>

### settingsCollection.updateLastSynced()
Updates the current OAuth client's last synchronization date

**Kind**: instance method of [<code>SettingsCollection</code>](#SettingsCollection)
<a name="SharingCollection"></a>

## SharingCollection
Expand Down
7 changes: 7 additions & 0 deletions packages/cozy-stack-client/src/SettingsCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ class SettingsCollection extends DocumentCollection {
data: normalizeSettings(resp.data)
}
}

/**
* Updates the current OAuth client's last synchronization date
*/
async updateLastSynced() {
return this.stackClient.fetchJSON('POST', '/settings/synchronized')
}
}

SettingsCollection.normalizeDoctype = normalizeDoctypeJsonApi
Expand Down

0 comments on commit 0dcd553

Please sign in to comment.