✨feature: Add success message display for site creation
This commit is contained in:
@@ -7,7 +7,7 @@ const sitesModel = new SiteModel();
|
||||
router.get('/', async function(req, res, next) {
|
||||
const sites = await sitesModel.getAll();
|
||||
// console.log('Sites:', sites);
|
||||
res.render('index', { title: 'Playwright Testing Dashboard', sites: sites });
|
||||
res.render('index', { title: 'Playwright Testing Dashboard', sites: sites, msg: '' });
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
|
||||
@@ -82,7 +82,9 @@ router.post('/add', async function (req, res, next) {
|
||||
if (!newSite) {
|
||||
res.status(400).send('Error creating site');
|
||||
} else {
|
||||
res.status(201).json(newSite);
|
||||
// res.status(201).json(newSite);
|
||||
const sites = await siteModel.getAll();
|
||||
res.render('index', { title: 'Playwright Testing Dashboard', sites: sites, msg: 'Site created successfully!' });
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user