mirror of
https://github.com/lasthead0/yandex2mqtt.git
synced 2025-08-08 09:01:00 +03:00
Release
This commit is contained in:
17
db/clients.js
Normal file
17
db/clients.js
Normal 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'));
|
||||
};
|
Reference in New Issue
Block a user