mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add date of last email confirmation send to admin user
This commit is contained in:
parent
2c88bc0383
commit
b3be4f664a
@ -22,6 +22,9 @@ export class UserAdmin {
|
|||||||
|
|
||||||
@Field(() => Boolean)
|
@Field(() => Boolean)
|
||||||
hasElopage: boolean
|
hasElopage: boolean
|
||||||
|
|
||||||
|
@Field(() => String, { nullable: true })
|
||||||
|
emailConfirmationSend?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
|
|||||||
@ -22,6 +22,9 @@ import { BalanceRepository } from '../../typeorm/repository/Balance'
|
|||||||
import { calculateDecay } from '../../util/decay'
|
import { calculateDecay } from '../../util/decay'
|
||||||
import { AdminPendingCreation } from '@entity/AdminPendingCreation'
|
import { AdminPendingCreation } from '@entity/AdminPendingCreation'
|
||||||
import { hasElopageBuys } from '../../util/hasElopageBuys'
|
import { hasElopageBuys } from '../../util/hasElopageBuys'
|
||||||
|
import { LoginEmailOptIn } from '@entity/LoginEmailOptIn'
|
||||||
|
|
||||||
|
const EMAIL_OPT_IN_REGISTER = 1
|
||||||
|
|
||||||
@Resolver()
|
@Resolver()
|
||||||
export class AdminResolver {
|
export class AdminResolver {
|
||||||
@ -42,6 +45,13 @@ export class AdminResolver {
|
|||||||
adminUser.creation = await getUserCreations(user.id)
|
adminUser.creation = await getUserCreations(user.id)
|
||||||
adminUser.emailChecked = user.emailChecked
|
adminUser.emailChecked = user.emailChecked
|
||||||
adminUser.hasElopage = await hasElopageBuys(user.email)
|
adminUser.hasElopage = await hasElopageBuys(user.email)
|
||||||
|
if (!user.emailChecked) {
|
||||||
|
const emailOptIn = await LoginEmailOptIn.findOne({
|
||||||
|
userId: user.id,
|
||||||
|
emailOptInTypeId: EMAIL_OPT_IN_REGISTER,
|
||||||
|
})
|
||||||
|
if (emailOptIn) adminUser.emailConfirmationSend = emailOptIn.updatedAt.toISOString()
|
||||||
|
}
|
||||||
return adminUser
|
return adminUser
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user