From 68ba6def1409b10df904bcce142aa4acb21e8b62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Mon, 12 Sep 2022 18:41:17 +0200 Subject: [PATCH] now find users including emailContact --- backend/src/util/klicktipp.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/util/klicktipp.ts b/backend/src/util/klicktipp.ts index c8f83acc3..0432f196e 100644 --- a/backend/src/util/klicktipp.ts +++ b/backend/src/util/klicktipp.ts @@ -7,16 +7,16 @@ export async function retrieveNotRegisteredEmails(): Promise { if (!con) { throw new Error('No connection to database') } - const users = await User.find() + const users = await User.find({ relations: ['emailContact'] }) const notRegisteredUser = [] for (let i = 0; i < users.length; i++) { const user = users[i] try { - await getKlickTippUser(user.email) + await getKlickTippUser(user.emailContact.email) } catch (err) { - notRegisteredUser.push(user.email) + notRegisteredUser.push(user.emailContact.email) // eslint-disable-next-line no-console - console.log(`${user.email}`) + console.log(`${user.emailContact.email}`) } } await con.close()