AuthorManager: normalize authorid parameter name

This commit is contained in:
webzwo0i 2021-06-18 12:06:09 +02:00
parent 7bdd0f2f09
commit 59612b1d96

View file

@ -181,41 +181,42 @@ exports.createAuthor = async (name) => {
/** /**
* Returns the Author Obj of the author * Returns the Author Obj of the author
* @param {String} author The id of the author * @param {String} authorID The id of the author
*/ */
exports.getAuthor = async (author) => await db.get(`globalAuthor:${author}`); exports.getAuthor = async (authorID) => await db.get(`globalAuthor:${authorID}`);
/** /**
* Returns the color Id of the author * Returns the color Id of the author
* @param {String} author The id of the author * @param {String} authorID The id of the author
*/ */
exports.getAuthorColorId = async (author) => await db.getSub(`globalAuthor:${author}`, ['colorId']); exports.getAuthorColorId = async (authorID) => await db.getSub(
`globalAuthor:${authorID}`, ['colorId']);
/** /**
* Sets the color Id of the author * Sets the color Id of the author
* @param {String} author The id of the author * @param {String} authorID The id of the author
* @param {String} colorId The color id of the author * @param {String} colorId The color id of the author
*/ */
exports.setAuthorColorId = async (author, colorId) => await db.setSub( exports.setAuthorColorId = async (authorID, colorId) => await db.setSub(
`globalAuthor:${author}`, ['colorId'], colorId); `globalAuthor:${authorID}`, ['colorId'], colorId);
/** /**
* Returns the name of the author * Returns the name of the author
* @param {String} author The id of the author * @param {String} authorID The id of the author
*/ */
exports.getAuthorName = async (author) => await db.getSub(`globalAuthor:${author}`, ['name']); exports.getAuthorName = async (authorID) => await db.getSub(`globalAuthor:${authorID}`, ['name']);
/** /**
* Sets the name of the author * Sets the name of the author
* @param {String} author The id of the author * @param {String} authorID The id of the author
* @param {String} name The name of the author * @param {String} name The name of the author
*/ */
exports.setAuthorName = async (author, name) => await db.setSub( exports.setAuthorName = async (authorID, name) => await db.setSub(
`globalAuthor:${author}`, ['name'], name); `globalAuthor:${authorID}`, ['name'], name);
/** /**
* Returns an array of all pads this author contributed to * Returns an array of all pads this author contributed to
* @param {String} author The id of the author * @param {String} authorID The id of the author
*/ */
exports.listPadsOfAuthor = async (authorID) => { exports.listPadsOfAuthor = async (authorID) => {
/* There are two other places where this array is manipulated: /* There are two other places where this array is manipulated:
@ -239,7 +240,7 @@ exports.listPadsOfAuthor = async (authorID) => {
/** /**
* Adds a new pad to the list of contributions * Adds a new pad to the list of contributions
* @param {String} author The id of the author * @param {String} authorID The id of the author
* @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.addPad = async (authorID, padID) => { exports.addPad = async (authorID, padID) => {
@ -266,7 +267,7 @@ exports.addPad = async (authorID, padID) => {
/** /**
* Removes a pad from the list of contributions * Removes a pad from the list of contributions
* @param {String} author The id of the author * @param {String} authorID The id of the author
* @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) => {