Remove parse function
This commit is contained in:
parent
302e0cc60a
commit
b52e310d41
|
@ -1,16 +1,14 @@
|
|||
const parseSAMAccountName = sAMAccountName =>
|
||||
sAMAccountName ? sAMAccountName.replace('.', ' ') : ''
|
||||
// const parseSAMAccountName = sAMAccountName =>
|
||||
// sAMAccountName ? sAMAccountName.replace('.', ' ') : ''
|
||||
|
||||
export async function users(
|
||||
parent,
|
||||
{ where: { cn, displayName, sAMAccountName }, limit, onlyStudents },
|
||||
{ ad }
|
||||
) {
|
||||
const parsedSAMAccountName = parseSAMAccountName(sAMAccountName)
|
||||
|
||||
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
|
||||
? `(&(memberOf=CN=${studentGroup},OU=Groups,DC=ifms,DC=edu,DC=br)(${search}))`
|
||||
|
@ -22,6 +20,7 @@ export async function users(
|
|||
sizeLimit: limit
|
||||
})
|
||||
|
||||
console.dir(users)
|
||||
return users.map(user => ({ ...user, roles: [] })) || []
|
||||
} catch (e) {
|
||||
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_WS="ws://10.7.0.54:4000/graphql"
|
||||
VUE_APP_GRAPHQL_HTTP="http://10.7.1.1:4000/graphql"
|
||||
VUE_APP_GRAPHQL_WS="ws://10.7.1.1:4000/graphql"
|
||||
|
|
Loading…
Reference in New Issue
Block a user