Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #520 from owncloud/settings-api-params
Browse files Browse the repository at this point in the history
Adapt request to settings service to new API endpoint params
  • Loading branch information
Vincent Petry authored Aug 19, 2020
2 parents df7000e + e22826e commit 0c52dc4
Show file tree
Hide file tree
Showing 3 changed files with 338 additions and 62 deletions.
2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ codecov:
ci:
- drone.owncloud.com
- !appveyor
ignore:
- "vendor/settingsClient.js"
14 changes: 6 additions & 8 deletions src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ const SettingsClient = require('../vendor/settingsClient')
const Promise = require('promise')

/**
* @class SettingsValues
* @class Settings
* @classdesc
* <b><i> The SettingsValues class provides access to all settings values of the (most of the time authenticated) user.</i></b>
* <b><i> The Settings class provides access to all settings values of the (most of the time authenticated) user.</i></b>
*
* @author Benedikt Kulmann
* @version 1.0.0
Expand All @@ -28,20 +28,18 @@ class SettingsValues {
async getSettingsValues (accountUuid = 'me') {
try {
const baseUrl = this.helpers.getInstance().replace(/\/$/, '')
const response = await SettingsClient.ValueService_ListSettingsValues({
const response = await SettingsClient.ValueService_ListValues({
$domain: baseUrl,
body: {
identifier: {
account_uuid: accountUuid
}
account_uuid: accountUuid
}
})
if (response.status === 201) {
return Promise.resolve(response.data.settingsValues || [])
return Promise.resolve(response.data.values || [])
}
} catch (error) {
// fail on anything except settings service being unavailable
if (error.response.status !== 502 && error.response.status !== 404) {
if (error.response && error.response.status !== 502 && error.response.status !== 404) {
return Promise.reject(error)
}
}
Expand Down
Loading

0 comments on commit 0c52dc4

Please sign in to comment.