Skip to content

Commit caa659d

Browse files
zhijiezhijie
authored andcommitted
change getMemberDetailsById to return handle
1 parent 66f9a96 commit caa659d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/common/helper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ async function getMemberDetailsById (memberId) {
207207
try {
208208
const profile = await prisma.memberProfile.findUnique({
209209
where: {
210-
userId: memberId
210+
userId: _.toNumber(memberId)
211211
},
212212
select: {
213213
userId: true,
@@ -218,7 +218,7 @@ async function getMemberDetailsById (memberId) {
218218
if (!profile || !profile.userId) {
219219
throw new Error(`Member profile not found for memberId: ${memberId}`)
220220
}
221-
return { memberId: profile.userId, email: profile.email }
221+
return { memberId: profile.userId, email: profile.email, handle: profile.handle }
222222
} catch (e) {
223223
// fall back to v3 api...
224224
logger.warn(`Get Member by Handle from DB Failed, trying v3 Members API. Error: ${JSON.stringify(e)}`)

0 commit comments

Comments
 (0)