mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
move db call to get admin id before mutation
This commit is contained in:
parent
691d734c50
commit
3c04cf0621
@ -15,13 +15,13 @@ export const creationFactory = async (
|
||||
): Promise<void> => {
|
||||
const { mutate, query } = client
|
||||
|
||||
// login as Peter Lustig (admin)
|
||||
await query({ query: login, variables: { email: 'peter@lustig.de', password: 'Aa12345_' } })
|
||||
|
||||
// get Peter Lustig's user id
|
||||
const peterLustig = await User.findOneOrFail({ where: { email: 'peter@lustig.de' } })
|
||||
const variables = { ...creation, moderator: peterLustig.id }
|
||||
|
||||
// login as Peter Lustig (admin)
|
||||
await query({ query: login, variables: { email: 'peter@lustig.de', password: 'Aa12345_' } })
|
||||
|
||||
await mutate({ mutation: createPendingCreation, variables })
|
||||
|
||||
// get User
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user