fixup! fix(errors): properly output API error information

This commit is contained in:
Khaled Garbaya
2018-02-08 14:18:51 +01:00
committed by Khaled Garbaya
parent 9ee29c8555
commit fd6de6ef86
2 changed files with 14 additions and 3 deletions

View File

@@ -9,6 +9,8 @@ const { translate } = require('../i18n/i18n')
const { uniqWith, isEqual } = require('lodash')
const SETTINGS_NAME = 'theExampleAppSettings'
const querystring = require('querystring')
async function renderSettings (response, opts) {
// Get connected space to display the space name on top of the settings
let space = false
@@ -162,6 +164,11 @@ module.exports.postSettings = async (request, response, next) => {
updateCookie(response, SETTINGS_NAME, settings)
response.locals.settings = settings
const settingsQuery = {
editorial_features: response.locals.settings.editorialFeatures ? 'enabled' : 'disabled'
}
const settingsQs = querystring.stringify(settingsQuery)
response.locals.queryStringSettings = settingsQs ? `?${settingsQs}` : ''
// Reinit clients
initClients(settings)
}