-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployeesSearcher.js
More file actions
30 lines (25 loc) · 904 Bytes
/
EmployeesSearcher.js
File metadata and controls
30 lines (25 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const EmployeesDataBaseHandler = require('./EmployeesDataBaseHandler')
const db_password = require('./dbpswd')
class EmployeesSearcher {
constructor() {
this.empDbHandler = new EmployeesDataBaseHandler({
user: 'fqhdvfjibpslvq',
host: 'ec2-52-86-177-34.compute-1.amazonaws.com',
database: 'd591fltfo2mqg4',
password: process.env.DATABASE_PASSWORD || db_password,
port: 5432,
ssl: {
rejectUnauthorized: false
}
})
}
async getEmployees() {
// Returns all employees registered in the system.
return await this.empDbHandler.getEmployees()
}
async getEmployeesWithIds(ids) {
// Returns all employees with ids in 'ids' array in the system.
return await this.empDbHandler.getEmployeesWithIds(ids)
}
}
module.exports = EmployeesSearcher