Skip to content

Commit c542371

Browse files
committed
Logs removed and database configuration fixed
1 parent aa0b34c commit c542371

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
lines changed

api/src/app/routes/controllers/DebitsController.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@ class DebitsController {
66
const { startDate, endDate } = req.query;
77
const { userid } = req.headers;
88

9-
console.log('Going to access DebitsService!');
10-
119
const debits = await DebitsService.index(startDate, endDate, userid);
1210

13-
console.log('Returning data from API');
14-
1511
return res.json(debits);
1612
}
1713

api/src/app/services/DebitsService.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,8 @@ const order = [['date', 'DESC']];
44

55
class DebitsService {
66
async index(startDate, endDate, userId) {
7-
console.log('startDate: ', startDate);
8-
console.log('endDate: ', endDate);
9-
console.log('userId: ', userId);
10-
117
const newEndDate = new Date(endDate);
12-
console.log('newEndDate: ', newEndDate);
138
newEndDate.setDate(newEndDate.getDate() + 1);
14-
console.log('newEndDate after add: ', newEndDate);
159

1610
const where = {
1711
user_id: userId,
@@ -23,14 +17,7 @@ class DebitsService {
2317
}
2418
};
2519

26-
console.log('Going to access database!');
27-
let debit;
28-
29-
try {
30-
debit = await Debit.findAll({ where, order });
31-
} catch (err) {
32-
console.log('Erro database: ', err);
33-
}
20+
const debit = await Debit.findAll({ where, order });
3421

3522
return debit;
3623
}

api/src/config/database.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ module.exports = {
66
password: process.env.POSTGRES_PASSWORD,
77
database: process.env.POSTGRES_DB,
88
operatorAliases: false,
9+
ssl: true,
910
dialectOptions: {
1011
ssl: {
12+
require: true,
1113
rejectUnauthorized: false
1214
}
1315
},

0 commit comments

Comments
 (0)