From c93a6194a28312832949d521a64af1b83cca4344 Mon Sep 17 00:00:00 2001 From: webzwo0i Date: Fri, 18 Jun 2021 12:10:12 +0200 Subject: [PATCH] AuthorManager: reuse getAuthor fun --- src/node/db/AuthorManager.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/node/db/AuthorManager.js b/src/node/db/AuthorManager.js index 40e0e0e85..63e151407 100644 --- a/src/node/db/AuthorManager.js +++ b/src/node/db/AuthorManager.js @@ -94,7 +94,7 @@ exports.getColorPalette = () => [ * Checks if the author exists */ exports.doesAuthorExist = async (authorID) => { - const author = await db.get(`globalAuthor:${authorID}`); + const author = await exports.getAuthor(authorID); return author != null; }; @@ -225,7 +225,7 @@ exports.listPadsOfAuthor = async (authorID) => { */ // get the globalAuthor - const author = await db.get(`globalAuthor:${authorID}`); + const author = await exports.getAuthor(authorID); if (author == null) { // author does not exist @@ -245,7 +245,7 @@ exports.listPadsOfAuthor = async (authorID) => { */ exports.addPad = async (authorID, padID) => { // get the entry - const author = await db.get(`globalAuthor:${authorID}`); + const author = await exports.getAuthor(authorID); 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 */ exports.removePad = async (authorID, padID) => { - const author = await db.get(`globalAuthor:${authorID}`); + const author = await exports.getAuthor(authorID); if (author == null) return;