mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #1526 from gradido/fix-empty-ids-for-get-creations
fix: Return Empty Array When No Pending Creations Are Present
This commit is contained in:
commit
b425124721
@ -200,6 +200,10 @@ export class AdminResolver {
|
||||
@Query(() => [PendingCreation])
|
||||
async getPendingCreations(): Promise<PendingCreation[]> {
|
||||
const pendingCreations = await AdminPendingCreation.find()
|
||||
if (pendingCreations.length === 0) {
|
||||
return []
|
||||
}
|
||||
|
||||
const userIds = pendingCreations.map((p) => p.userId)
|
||||
const userCreations = await getUserCreations(userIds)
|
||||
const users = await User.find({ id: In(userIds) })
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user