API: Add optional authorId param to mutation functions

This commit is contained in:
Richard Hansen 2022-02-16 23:25:19 -05:00
parent 50fafe608b
commit aa286b7dbd
6 changed files with 93 additions and 42 deletions

View file

@ -103,7 +103,7 @@ exports.createGroupIfNotExistsFor = async (groupMapper) => {
return result;
};
exports.createGroupPad = async (groupID, padName, text) => {
exports.createGroupPad = async (groupID, padName, text, authorId = '') => {
// create the padID
const padID = `${groupID}$${padName}`;
@ -123,7 +123,7 @@ exports.createGroupPad = async (groupID, padName, text) => {
}
// create the pad
await padManager.getPad(padID, text);
await padManager.getPad(padID, text, authorId);
// create an entry in the group for this pad
await db.setSub(`group:${groupID}`, ['pads', padID], 1);