This commit is contained in:
Evgenii Abramov
2021-01-18 01:52:32 +03:00
commit d6ae5dc1ea
26 changed files with 4083 additions and 0 deletions

17
db/clients.js Normal file
View File

@@ -0,0 +1,17 @@
'use strict';
const {clients} = require('../config');
module.exports.findById = (id, done) => {
for (const client of clients) {
if (client.id === id) return done(null, client);
}
return done(new Error('Client Not Found'));
};
module.exports.findByClientId = (clientId, done) => {
for (const client of clients) {
if (client.clientId === clientId) return done(null, client);
}
return done(new Error('Client Not Found'));
};