mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Refactor hasElopageBuys method to a utility method.
This commit is contained in:
parent
89af81b16c
commit
9d79e35f36
9
backend/src/util/hasElopageBuys.ts
Normal file
9
backend/src/util/hasElopageBuys.ts
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
import { getCustomRepository } from '@dbTools/typeorm'
|
||||
import { LoginElopageBuysRepository } from '../typeorm/repository/LoginElopageBuys'
|
||||
|
||||
export async function hasElopageBuys(email: string): Promise<boolean> {
|
||||
const loginElopageBuysRepository = getCustomRepository(LoginElopageBuysRepository)
|
||||
const elopageBuyCount = await loginElopageBuysRepository.count({ payerEmail: email })
|
||||
return elopageBuyCount > 0
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user