mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
db/Pad.js: convert to promises/async
Also updated some small chunks of dependent code that couldn't be converted until this one had been done.
This commit is contained in:
parent
ebb8a64e3c
commit
6d1b6b2796
4 changed files with 236 additions and 454 deletions
|
@ -144,12 +144,11 @@ exports.getAuthor = function(author)
|
|||
/**
|
||||
* Returns the color Id of the author
|
||||
* @param {String} author The id of the author
|
||||
* @param {Function} callback callback(err, colorId)
|
||||
*/
|
||||
exports.getAuthorColorId = thenify(function(author, callback)
|
||||
exports.getAuthorColorId = function(author)
|
||||
{
|
||||
db.db.getSub("globalAuthor:" + author, ["colorId"], callback);
|
||||
});
|
||||
return db.getSub("globalAuthor:" + author, ["colorId"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the color Id of the author
|
||||
|
@ -164,12 +163,11 @@ exports.setAuthorColorId = function(author, colorId)
|
|||
/**
|
||||
* Returns the name of the author
|
||||
* @param {String} author The id of the author
|
||||
* @param {Function} callback callback(err, name)
|
||||
*/
|
||||
exports.getAuthorName = thenify(function(author, callback)
|
||||
exports.getAuthorName = function(author)
|
||||
{
|
||||
db.db.getSub("globalAuthor:" + author, ["name"], callback);
|
||||
});
|
||||
return db.getSub("globalAuthor:" + author, ["name"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the name of the author
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue