mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
AuthorManager: reuse getAuthor fun
This commit is contained in:
parent
59612b1d96
commit
c93a6194a2
1 changed files with 4 additions and 4 deletions
|
@ -94,7 +94,7 @@ exports.getColorPalette = () => [
|
||||||
* Checks if the author exists
|
* Checks if the author exists
|
||||||
*/
|
*/
|
||||||
exports.doesAuthorExist = async (authorID) => {
|
exports.doesAuthorExist = async (authorID) => {
|
||||||
const author = await db.get(`globalAuthor:${authorID}`);
|
const author = await exports.getAuthor(authorID);
|
||||||
|
|
||||||
return author != null;
|
return author != null;
|
||||||
};
|
};
|
||||||
|
@ -225,7 +225,7 @@ exports.listPadsOfAuthor = async (authorID) => {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// get the globalAuthor
|
// get the globalAuthor
|
||||||
const author = await db.get(`globalAuthor:${authorID}`);
|
const author = await exports.getAuthor(authorID);
|
||||||
|
|
||||||
if (author == null) {
|
if (author == null) {
|
||||||
// author does not exist
|
// author does not exist
|
||||||
|
@ -245,7 +245,7 @@ exports.listPadsOfAuthor = async (authorID) => {
|
||||||
*/
|
*/
|
||||||
exports.addPad = async (authorID, padID) => {
|
exports.addPad = async (authorID, padID) => {
|
||||||
// get the entry
|
// get the entry
|
||||||
const author = await db.get(`globalAuthor:${authorID}`);
|
const author = await exports.getAuthor(authorID);
|
||||||
|
|
||||||
if (author == null) return;
|
if (author == null) return;
|
||||||
|
|
||||||
|
@ -271,7 +271,7 @@ exports.addPad = async (authorID, padID) => {
|
||||||
* @param {String} padID The id of the pad the author contributes to
|
* @param {String} padID The id of the pad the author contributes to
|
||||||
*/
|
*/
|
||||||
exports.removePad = async (authorID, padID) => {
|
exports.removePad = async (authorID, padID) => {
|
||||||
const author = await db.get(`globalAuthor:${authorID}`);
|
const author = await exports.getAuthor(authorID);
|
||||||
|
|
||||||
if (author == null) return;
|
if (author == null) return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue