Skip to content

Commit

Permalink
feat: Add instance data in loadInstanceOptionsFromStack
Browse files Browse the repository at this point in the history
  • Loading branch information
zatteo committed Aug 31, 2023
1 parent e03c217 commit 26a726c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/cozy-client/src/CozyClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -1676,17 +1676,20 @@ instantiation of the client.`
/**
* loadInstanceOptionsFromStack - Loads the instance options from cozy-stack and exposes it through getInstanceOptions
*
* For now only retrieving capabilities is supported
*
* @returns {Promise<void>}
*/
async loadInstanceOptionsFromStack() {
const { data } = await this.query(
Q('io.cozy.settings').getById('io.cozy.settings.capabilities')
)

const { data: instanceData } = await this.query(
Q('io.cozy.settings').getById('io.cozy.settings.instance')
)

this.instanceOptions = {
capabilities: data.attributes
capabilities: data.attributes,
...instanceData.attributes
}

this.capabilities = this.instanceOptions.capabilities || null
Expand Down

0 comments on commit 26a726c

Please sign in to comment.