Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions packages/cozy-stack-client/src/SettingsCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,24 @@ class SettingsCollection extends DocumentCollection {
* @returns {object} The response from the route
*/
async get(id) {
// This is a dirty quick fix waiting for this issue to be resolved
// https://github.com/cozy/cozy-stack/issues/3864
if (id === 'io.cozy.settings.bitwarden') {
const resp = await this.stackClient.fetchJSON(
'GET',
'/data/io.cozy.settings/io.cozy.settings.bitwarden'
)
return {
data: DocumentCollection.normalizeDoctypeJsonApi(SETTINGS_DOCTYPE)(
{
id: '/data/io.cozy.settings/io.cozy.settings.bitwarden',
...resp
Comment thread
Crash-- marked this conversation as resolved.
},
resp
)
}
}

let path

if (id.startsWith('io.cozy.settings.')) {
Expand Down
6 changes: 6 additions & 0 deletions packages/cozy-stack-client/src/SettingsCollection.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ describe('SettingsCollection', () => {
'GET',
'/settings/disk-usage'
)

await collection.get('io.cozy.settings.bitwarden')
expect(stackClient.fetchJSON).toHaveBeenCalledWith(
'GET',
'/data/io.cozy.settings/io.cozy.settings.bitwarden'
)
})

it('should format correctly the response', async () => {
Expand Down