Skip to content

Commit 28eb4e5

Browse files
author
Alex G Rice
authored
Fix members and moderators in listTeams response. (#176)
- Fixes a bug caused by #173 - listMembers() and listModerators() should not join with users table (they are just osm users, but probably not app users)
1 parent 0205ea3 commit 28eb4e5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/lib/team.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ async function list (options) {
121121
*/
122122
async function listMembers (teamIds) {
123123
const conn = await db()
124-
return conn('member').whereIn('team_id', teamIds)
125-
.join('users', 'member.osm_id', 'users.id')
124+
return conn('member')
126125
.select('team_id', 'osm_id')
126+
.whereIn('team_id', teamIds)
127127
}
128128

129129
/**
@@ -135,9 +135,9 @@ async function listMembers (teamIds) {
135135
*/
136136
async function listModerators (teamIds) {
137137
const conn = await db()
138-
return conn('moderator').whereIn('team_id', teamIds)
139-
.join('users', 'moderator.osm_id', 'users.id')
138+
return conn('moderator')
140139
.select('team_id', 'osm_id')
140+
.whereIn('team_id', teamIds)
141141
}
142142

143143
/**

0 commit comments

Comments
 (0)