FormHelperComponent: don't flash empty previous form data
This commit is contained in:
parent
5caa0be862
commit
aed825c4d6
@ -37,7 +37,7 @@ export default class FormHelperComponent extends ApplicationComponent {
|
|||||||
|
|
||||||
router.use((req, res, next) => {
|
router.use((req, res, next) => {
|
||||||
if (['GET', 'POST'].find(m => m === req.method)) {
|
if (['GET', 'POST'].find(m => m === req.method)) {
|
||||||
if (typeof req.body === 'object') {
|
if (typeof req.body === 'object' && Object.keys(req.body).length > 0) {
|
||||||
req.flash('previousFormData', req.body);
|
req.flash('previousFormData', req.body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user