make the tests work

This commit is contained in:
Girish Ramakrishnan
2021-06-29 09:44:16 -07:00
parent 31498afe39
commit ea430b255b
11 changed files with 461 additions and 371 deletions

View File

@@ -7,8 +7,8 @@ exports = module.exports = {
getByName,
update,
getWithMembers,
getAll,
getAllWithMembers,
list,
listWithMembers,
getMembers,
addMember,
@@ -121,12 +121,12 @@ async function getWithMembers(id) {
return result;
}
async function getAll() {
async function list() {
const results = await database.query('SELECT ' + GROUPS_FIELDS + ' FROM userGroups ORDER BY name');
return results;
}
async function getAllWithMembers() {
async function listWithMembers() {
const results = await database.query('SELECT ' + GROUPS_FIELDS + ',GROUP_CONCAT(groupMembers.userId) AS userIds ' +
' FROM userGroups LEFT OUTER JOIN groupMembers ON userGroups.id = groupMembers.groupId ' +
' GROUP BY userGroups.id ORDER BY name');