feat(editorial-features): switch logic to allow disabling via url params
This commit is contained in:
committed by
Benedikt Rötsch
parent
bccdb86f2c
commit
9783eda8a0
@@ -31,13 +31,15 @@ module.exports = async function settingsMiddleware (request, response, next) {
|
||||
updateCookie(response, SETTINGS_NAME, settings)
|
||||
}
|
||||
|
||||
// Allow enabling of editorial features via query parameters
|
||||
const { enable_editorial_features } = request.query
|
||||
if (enable_editorial_features !== undefined) { // eslint-disable-line camelcase
|
||||
delete request.query.enable_editorial_features
|
||||
settings.editorialFeatures = true
|
||||
// Allow enabling and disabling of editorial features via query parameters
|
||||
/* eslint-disable camelcase */
|
||||
const { editorial_features } = request.query
|
||||
if (typeof editorial_features !== 'undefined') {
|
||||
delete request.query.editorial_features
|
||||
settings.editorialFeatures = editorial_features === 'enabled'
|
||||
updateCookie(response, SETTINGS_NAME, settings)
|
||||
}
|
||||
/* eslint-enable camelcase */
|
||||
|
||||
// The space id needs to be available in the frontend for our example app
|
||||
response.cookie('space_id', settings.spaceId)
|
||||
|
||||
Reference in New Issue
Block a user