/* ============================================================================ *\
|| ########################################################################## ||
|| # Auction Software Marketplace Release: 0.6 Build 0.7 # ||
|| # ---------------------------------------------------------------------- # ||
|| # License # 35YAHCNR9344X6O666C123AB # ||
|| # ---------------------------------------------------------------------- # ||
|| # Copyright ©2014–2021 Develop Scripts LLC. All Rights Reserved # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ------------- AUCTION SOFTWARE IS NOT FREE SOFTWARE ------------------ # ||
|| # http://www.auctionsoftwaremarketplace.com|support@auctionsoftware.com # ||
|| # ---------------------------------------------------------------------- # ||
|| ########################################################################## ||
\* ============================================================================ */
/* eslint-disable prefer-destructuring */
/* eslint-disable no-param-reassign */
const jwt = require('jsonwebtoken')
const commonModule = require('../../modules/commonModule').default
const commonFunction = require('../../../common/function').default
const schemaModule = require('./schema').default
const { jsonResponse } = require('../logger')
module.exports = {
/**
* Get Common Values
*
* @memberOf frontend.common
* @param {object} req req object
* @param {object} res res object
*/
commonValues: async (req, res) => {
try {
const responseData = global.configurations
jsonResponse(res, 'success', {
responseType: 1,
message: 'Settings variables successfully retrieved!',
responseData,
})
} catch (e) {
console.error(e)
jsonResponse(res, 'error', {
responseType: 3,
message: 'Internal Server error!',
})
}
},
/**
* Get Static pages
*
* @memberOf frontend.common
* @param {commonModule.getStaticContent} module
*/
getStaticPage: async (req, res) => {
let record = {}
try {
const id = typeof req.body.id === 'undefined' ? '' : req.body.id
const [records] = await Promise.all([commonModule.getStaticContent(id)])
record = records[0]
} catch (e) {
console.error(e)
jsonResponse(res, 'error', {
responseType: 3,
message: 'Internal Server error!',
})
} finally {
const responseData = { record }
jsonResponse(res, 'success', {
responseType: 1,
message: 'Details successfully retrieved!',
responseData,
})
}
},
}