feature: Add success message display for site creation

This commit is contained in:
Keith Solomon
2025-05-27 19:25:27 -05:00
parent cfba9672ef
commit 309e174a46
4 changed files with 77 additions and 2 deletions

View File

@@ -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;

View File

@@ -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!' });
}
});