Correcting the userId fetching to avoid possible loops
This commit is contained in:
1 parent
5ab5b42743
commit
cd2053f2dd
1 file changed
+6
-3
+6
-3
@@ -18,12 +18,15 @@ async function getUserId (authId) {
|
||||
}
|
||||
|
||||
const userData = await axios({
|
||||
url: process.env.GRAPHQL_API_URL,
|
||||
url: process.env.USERS_API_URL,
|
||||
method: 'post',
|
||||
headers: {
|
||||
preshared: USERS_API_PRESHARED
|
||||
},
|
||||
data: {
|
||||
query: `
|
||||
{
|
||||
users_UserByAuthId(authId: "${authId}")
|
||||
userByAuthId(authId: "${authId}")
|
||||
{
|
||||
id
|
||||
}
|
||||
@@ -31,7 +34,7 @@ async function getUserId (authId) {
|
||||
`
|
||||
}
|
||||
})
|
||||
return userData.data.data.users_UserByAuthId.id
|
||||
return userData.data.data.userByAuthId.id
|
||||
} catch (error) {
|
||||
return (error)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user