Provide getByAppIdAndType() by clients.js

This commit is contained in:
Johannes Zellner
2016-06-03 14:47:06 +02:00
parent 201efa70b7
commit 725e1debcc
5 changed files with 20 additions and 4 deletions
+12
View File
@@ -7,6 +7,7 @@ exports = module.exports = {
get: get,
del: del,
getAllWithDetailsByUserId: getAllWithDetailsByUserId,
getByAppIdAndType: getByAppIdAndType,
getClientTokensByUserId: getClientTokensByUserId,
delClientTokensByUserId: delClientTokensByUserId,
@@ -170,6 +171,17 @@ function getAllWithDetailsByUserId(userId, callback) {
});
}
function getByAppIdAndType(appId, type, callback) {
assert.strictEqual(typeof appId, 'string');
assert.strictEqual(typeof type, 'string');
assert.strictEqual(typeof callback, 'function');
clientdb.getByAppIdAndType(appId, type, function (error, result) {
if (error) return callback(error);
callback(null, result);
});
}
function getClientTokensByUserId(clientId, userId, callback) {
assert.strictEqual(typeof clientId, 'string');
assert.strictEqual(typeof userId, 'string');