From c3ddbd717528f8b79d95818fe85c3b5ab92b2006 Mon Sep 17 00:00:00 2001 From: Antoine WEBER Date: Thu, 24 Sep 2015 18:22:21 +0200 Subject: [PATCH] =?UTF-8?q?on=20ferme=20la=20base=20apres=20les=20op=C3=A9?= =?UTF-8?q?rations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routes/show.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/routes/show.js b/routes/show.js index 45708ce..f5be626 100644 --- a/routes/show.js +++ b/routes/show.js @@ -54,26 +54,27 @@ router.get('/:id', function(req, res, next) { data.push(row); }, - function() { //a la fin du foreach }); + db.close(function(){ + //aprés toute les opération de la base + var titre = "Série inexistante"; + if(show != null){ + title = 'Episode de '+show.title; + } + res.render('show',{ + title: titre, + show: show, + videos: data + }); + }); + - },function(){ - //aprés toute les opération de la base - var titre = "Série inexistante"; - if(show != null){ - title = 'Episode de '+show.title; - } - res.render('show',{ - title: titre, - show: show, - videos: data - }); }); - db.close(); + }); module.exports = router;