mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
improve matching of created pending creation, see TODO
This commit is contained in:
parent
e4776fcfd5
commit
6f0c3c11a5
@ -22,13 +22,13 @@ export const creationFactory = async (
|
||||
|
||||
await query({ query: login, variables: { email: 'peter@lustig.de', password: 'Aa12345_' } })
|
||||
|
||||
// TODO it would be nice to have this mutation return the id
|
||||
await mutate({ mutation: createPendingCreation, variables: { ...creation } })
|
||||
|
||||
// get User
|
||||
const user = await User.findOneOrFail({ where: { email: creation.email } })
|
||||
|
||||
const pendingCreation = await AdminPendingCreation.findOneOrFail({
|
||||
where: { userId: user.id },
|
||||
where: { userId: user.id, amount: creation.amount },
|
||||
order: { created: 'DESC' },
|
||||
})
|
||||
|
||||
|
||||
@ -133,3 +133,9 @@ export const updatePendingCreation = gql`
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const deletePendingCreation = gql`
|
||||
mutation ($id: Int!) {
|
||||
deletePendingCreation(id: $id)
|
||||
}
|
||||
`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user