mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
now find users including emailContact
This commit is contained in:
parent
e6155d52e1
commit
68ba6def14
@ -7,16 +7,16 @@ export async function retrieveNotRegisteredEmails(): Promise<string[]> {
|
|||||||
if (!con) {
|
if (!con) {
|
||||||
throw new Error('No connection to database')
|
throw new Error('No connection to database')
|
||||||
}
|
}
|
||||||
const users = await User.find()
|
const users = await User.find({ relations: ['emailContact'] })
|
||||||
const notRegisteredUser = []
|
const notRegisteredUser = []
|
||||||
for (let i = 0; i < users.length; i++) {
|
for (let i = 0; i < users.length; i++) {
|
||||||
const user = users[i]
|
const user = users[i]
|
||||||
try {
|
try {
|
||||||
await getKlickTippUser(user.email)
|
await getKlickTippUser(user.emailContact.email)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
notRegisteredUser.push(user.email)
|
notRegisteredUser.push(user.emailContact.email)
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log(`${user.email}`)
|
console.log(`${user.emailContact.email}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await con.close()
|
await con.close()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user