From c313834d69fb7228a90fe0f2c72b2257c2387a01 Mon Sep 17 00:00:00 2001 From: Chidi Orji Date: Wed, 22 May 2019 15:22:16 +0100 Subject: [PATCH] chore: minor non-breaking changes --- UI/js/dashboard.js | 4 ++-- middleware/validators.loans.js | 1 - models/Model.js | 5 ++++- test/users-spec.js | 6 +++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/UI/js/dashboard.js b/UI/js/dashboard.js index 7195fdd..cad26cd 100644 --- a/UI/js/dashboard.js +++ b/UI/js/dashboard.js @@ -11,8 +11,8 @@ const id = 1; const bucket = 'quick-credit'; const folder = 'profile_photos'; const endpoint = 's3.eu-west-2.amazonaws.com'; -// const base_url = 'https://qcredit.herokuapp.com'; -const base_url = 'http://localhost:3000'; +const base_url = 'https://qcredit.herokuapp.com'; +// const base_url = 'http://localhost:3000'; // const reload_pix = () => { // const container = document.getElementById('photo_window'); diff --git a/middleware/validators.loans.js b/middleware/validators.loans.js index 84e2200..7eb45f4 100644 --- a/middleware/validators.loans.js +++ b/middleware/validators.loans.js @@ -1,6 +1,5 @@ import { body } from 'express-validator/check'; import { sanitizeBody } from 'express-validator/filter'; -import { test_logger } from '../utils/loggers'; import validate_error_or_next from './validate_error_or_next'; diff --git a/models/Model.js b/models/Model.js index 18aadb3..6523c14 100644 --- a/models/Model.js +++ b/models/Model.js @@ -6,7 +6,10 @@ class Model { this.table = table; this.pool = pool; this.pool.on('error', (err, client) => { - dev_logger(`****Unexpected error on idle client, ${err}`); + if (err) { + dev_logger(`****Unexpected error on idle client, ${err}`); + } + dev_logger(`Client: ${client}`); process.exit(-1); }); } diff --git a/test/users-spec.js b/test/users-spec.js index 1833ec3..1aaed42 100644 --- a/test/users-spec.js +++ b/test/users-spec.js @@ -74,7 +74,7 @@ describe('/users', () => { .end((err, res) => { res.status.should.equal(404); res.body.error.should.equal( - `User with email ${email} already exists`) + `User with email ${email} already exists`); done(); }); }); @@ -333,7 +333,7 @@ describe('/users', () => { }); it('should indicate if user is not found', done => { - const id = 100 + const id = 100; server .patch(`/users/${100}/update`) .send({ @@ -345,7 +345,7 @@ describe('/users', () => { .expect(200) .end((err, res) => { res.status.should.equal(404); - res.body.error.should.equal(`User with id ${id} not found`) + res.body.error.should.equal(`User with id ${id} not found`); done(); }); });