From eac1cd46ffabf6d892b50a24bb4be72143ba4023 Mon Sep 17 00:00:00 2001 From: Quentin PANISSIER Date: Sat, 24 Jan 2015 11:41:54 +0100 Subject: [PATCH] Correction de plusieurs bugs --- routes/cron.js | 15 +++++++++------ routes/pushbulletApi.js | 6 +++--- views/index.jade | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/routes/cron.js b/routes/cron.js index 3da805c..24daa5d 100644 --- a/routes/cron.js +++ b/routes/cron.js @@ -32,9 +32,12 @@ exports.handleRequests = function( req, res, next ) { }, function( err ) { - if( err ) { next( err ); return; } - - res.send('PROCESSING REQUESTS COMPLETED !'); + if( err ) { + next( err ); + return; + } else { + res.send('PROCESSING REQUESTS COMPLETED !'); + } }); @@ -76,9 +79,9 @@ var inform = function( res, request, next ) { // Envoi du mail de notification mailer.send( payload, next ); - if( request.phone ) - // Envoi du sms de notification - ovh.sendSms( res, request.name, request.phone, next ); + // if( request.phone ) + // Envoi du sms de notification + // ovh.sendSms( res, request.name, request.phone, next ); if( request.pushbullet_token ) // Envoi de la notification à Pushbullet diff --git a/routes/pushbulletApi.js b/routes/pushbulletApi.js index 4ffaac7..5f83b83 100644 --- a/routes/pushbulletApi.js +++ b/routes/pushbulletApi.js @@ -19,7 +19,7 @@ exports.auth = function( code, next, callback ) { }, function( err, response, body ) { if( err || response.statusCode != 200 ) { - next( new Error("PUSHBULLET API - OAUTH Request failed : " + body.error.message) ); + next( new Error("PUSHBULLET API - OAUTH Request failed") ); return; } @@ -63,7 +63,7 @@ exports.sendNotification = function( token, offer, orderUrl ) { }, function( err, response, body ) { if( err || response.statusCode != 200 ) { - console.log("PUSHBULLET API - Request failed : " + body.error.message ); + console.log("PUSHBULLET API - Request failed"); } }); @@ -88,7 +88,7 @@ var callApi = function( url, method, token, params, next, callback ) { }, function( err, response, body ) { if( err || response.statusCode != 200 ) { - next( new Error("PUSHBULLET API - Request failed : " + body.error.message) ); + next( new Error("PUSHBULLET API - Request failed") ); return; } diff --git a/views/index.jade b/views/index.jade index c7c075c..6da69d6 100644 --- a/views/index.jade +++ b/views/index.jade @@ -82,7 +82,7 @@ block content if formErrors["phone"] span.help-block #{formErrors["phone"]["msg"]} - .row + div(class='row' style='display:none') .col-md-6.col-md-offset-3 .form-group