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

Adapt request to settings service to new API endpoint params #520

Merged
merged 4 commits into from
Aug 19, 2020
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
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