Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
languages: res.locals.languages,
editionStatuses: res.locals.editionStatuses,
editionFormats: res.locals.editionFormats,
identifierTypes: res.locals.identifierTypes,
submissionUrl: '/edition/create/handler'
};
if (req.query.publication) {
propsPromise.publication =
Publication.forge({bbid: req.query.publication})
.fetch({withRelated: 'defaultAlias'});
}
if (req.query.publisher) {
propsPromise.publisher =
Publisher.forge({bbid: req.query.publisher})
.fetch({withRelated: 'defaultAlias'});
}
function render(props) {
const markup = ReactDOMServer.renderToString(EditForm(props));
res.render('entity/create/edition', {
title: 'Add Edition',
heading: 'Create Edition',
subheading: 'Add a new Edition to BookBrainz',
props,
markup
});
}
Promise.props(propsPromise).then(render);