mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: pass interstital errors to individual partials as well as to registerComplete
This commit is contained in:
@@ -204,15 +204,16 @@ Controllers.registerInterstitial = async function (req, res, next) {
|
|||||||
return helpers.redirect(res, returnTo || '/');
|
return helpers.redirect(res, returnTo || '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const errors = req.flash('errors');
|
||||||
const renders = data.interstitials.map(
|
const renders = data.interstitials.map(
|
||||||
interstitial => req.app.renderAsync(interstitial.template, interstitial.data || {})
|
interstitial => req.app.renderAsync(interstitial.template, { ...interstitial.data || {}, errors })
|
||||||
);
|
);
|
||||||
const sections = await Promise.all(renders);
|
const sections = await Promise.all(renders);
|
||||||
|
|
||||||
res.render('registerComplete', {
|
res.render('registerComplete', {
|
||||||
title: '[[pages:registration-complete]]',
|
title: '[[pages:registration-complete]]',
|
||||||
errors: req.flash('errors'),
|
|
||||||
sections: sections,
|
sections: sections,
|
||||||
|
errors,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
next(err);
|
next(err);
|
||||||
|
|||||||
Reference in New Issue
Block a user