Remove parse function
This commit is contained in:
parent
302e0cc60a
commit
b52e310d41
|
@ -1,16 +1,14 @@
|
||||||
const parseSAMAccountName = sAMAccountName =>
|
// const parseSAMAccountName = sAMAccountName =>
|
||||||
sAMAccountName ? sAMAccountName.replace('.', ' ') : ''
|
// sAMAccountName ? sAMAccountName.replace('.', ' ') : ''
|
||||||
|
|
||||||
export async function users(
|
export async function users(
|
||||||
parent,
|
parent,
|
||||||
{ where: { cn, displayName, sAMAccountName }, limit, onlyStudents },
|
{ where: { cn, displayName, sAMAccountName }, limit, onlyStudents },
|
||||||
{ ad }
|
{ ad }
|
||||||
) {
|
) {
|
||||||
const parsedSAMAccountName = parseSAMAccountName(sAMAccountName)
|
|
||||||
|
|
||||||
const studentGroup = process.env.STUDENT_GROUP || 'Estudantes'
|
const studentGroup = process.env.STUDENT_GROUP || 'Estudantes'
|
||||||
|
|
||||||
const search = `|(sAMAccountName=*${parsedSAMAccountName}*)(cn=*${cn}*)(displayName=*${displayName}*)`
|
const search = `|(sAMAccountName=*${sAMAccountName}*)(cn=*${cn}*)(displayName=*${displayName}*)`
|
||||||
|
|
||||||
const filter = onlyStudents
|
const filter = onlyStudents
|
||||||
? `(&(memberOf=CN=${studentGroup},OU=Groups,DC=ifms,DC=edu,DC=br)(${search}))`
|
? `(&(memberOf=CN=${studentGroup},OU=Groups,DC=ifms,DC=edu,DC=br)(${search}))`
|
||||||
|
@ -22,6 +20,7 @@ export async function users(
|
||||||
sizeLimit: limit
|
sizeLimit: limit
|
||||||
})
|
})
|
||||||
|
|
||||||
|
console.dir(users)
|
||||||
return users.map(user => ({ ...user, roles: [] })) || []
|
return users.map(user => ({ ...user, roles: [] })) || []
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new Error('Não foi possível realizar a busca.')
|
throw new Error('Não foi possível realizar a busca.')
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
VUE_APP_GRAPHQL_HTTP="http://10.7.0.54:4000/graphql"
|
VUE_APP_GRAPHQL_HTTP="http://10.7.1.1:4000/graphql"
|
||||||
VUE_APP_GRAPHQL_WS="ws://10.7.0.54:4000/graphql"
|
VUE_APP_GRAPHQL_WS="ws://10.7.1.1:4000/graphql"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user