Skip to content

Commit 0885362

Browse files
authored
Merge pull request #356 from developmentseed/fix/resolve-member-names
Make sure user ids are integers when resolving member names
2 parents 2dde70b + b54cbea commit 0885362

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/models/team.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,13 @@ const teamAttributes = [
6666
*
6767
*/
6868
async function resolveMemberNames(ids) {
69+
// TODO Quick fix, we need to do proper type validation
70+
const userIds = ids.map((i) => parseInt(i))
71+
6972
// get the display names from the database table first
70-
const foundUsers = await db('osm_users').whereIn('id', ids)
73+
const foundUsers = await db('osm_users').whereIn('id', userIds)
7174
const foundUserIds = foundUsers.map(prop('id'))
72-
const notFound = difference(ids, foundUserIds)
75+
const notFound = difference(userIds, foundUserIds)
7376

7477
let usersFromOSM = []
7578
if (notFound.length > 0) {

0 commit comments

Comments
 (0)