refactor: Improvements
* refactor: Update modal * refactor: Update settings page * feat: Add reset credentials * feat: Add .nvmrc and lodash * chore: Remove console.log * chore: nmvrc -> .nvmrc * chore: nmvrc -> .nvmrc
This commit is contained in:
committed by
Khaled Garbaya
parent
af9c453c52
commit
b5d69d71e7
@@ -31,6 +31,5 @@ module.exports.getLandingPage = async (request, response, next) => {
|
||||
if (shouldAttachEntryState(response)) {
|
||||
landingPage = await attachEntryState(landingPage)
|
||||
}
|
||||
console.log(landingPage.fields.contentModules[0].fields.course.fields.image)
|
||||
response.render('landingPage', { title: pathname, landingPage })
|
||||
}
|
||||
|
||||
@@ -59,7 +59,14 @@ module.exports.getSettings = async (request, response, next) => {
|
||||
module.exports.postSettings = async (request, response, next) => {
|
||||
const currentLocale = response.locals.currentLocale
|
||||
let errorList = []
|
||||
const { spaceId, deliveryToken, previewToken, editorialFeatures, qs } = request.body
|
||||
let { spaceId, deliveryToken, previewToken, editorialFeatures } = request.body
|
||||
|
||||
if (request.query.reset) {
|
||||
spaceId = process.env.CONTENTFUL_SPACE_ID
|
||||
deliveryToken = process.env.CONTENTFUL_DELIVERY_TOKEN
|
||||
previewToken = process.env.CONTENTFUL_PREVIEW_TOKEN
|
||||
}
|
||||
|
||||
const settings = {
|
||||
spaceId,
|
||||
deliveryToken,
|
||||
@@ -169,7 +176,6 @@ module.exports.postSettings = async (request, response, next) => {
|
||||
settings,
|
||||
errors,
|
||||
hasErrors: errorList.length > 0,
|
||||
success: errorList.length === 0,
|
||||
queryString: qs
|
||||
success: errorList.length === 0
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user