lib/responses.js
function checkArchivedToPublish(req, res, next) {
  if (req.body.archived) {
    return metaController.checkProps(req.uri, 'published')
      .then(resp => {
        if (resp === true) {
          throw new Error('Client error, cannot modify archive while page is published'); // archived true, published true
        } else next();
      })
      .catch(err => handleError(res)(err));
  } else next();
}
function checkArchivedToPublish(req, res, next) {
  if (req.body.archived) {
    return metaController.checkProps(req.uri, 'published')
      .then(resp => {
        if (resp === true) {
          throw new Error('Client error, cannot modify archive while page is published'); // archived true, published true
        } else next();
      })
      .catch(err => handleError(res)(err));
  } else next();
}
function checkArchivedToPublish ( req , res , next ) { if ( req . body . archived ) { return metaController . checkProps ( req . uri , 'published' ) . then ( resp => { if ( resp === true ) { throw new Error ( 'Client error, cannot modify archive while page is published' ) ; // archived true, published true } else next ( ) ; } ) . catch ( err => handleError ( res ) ( err ) ) ; } else next ( ) ; }
Checks the archived property on the request object to determine if the
request is attempting to archive the page. If true, checks the published
property on the meta object of the page, by calling checkProps.
@param {object} req
@param {object} res
@param {function} next
@returns {Promise | void}
Checks the archived property on the request object to determine if the request is attempting to archive the page . If true checks the published property on the meta object of the page by calling checkProps .