From 3c04cf062173e104133aad7fce44bf7e4dd093da Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 16 Mar 2022 21:18:01 +0100 Subject: [PATCH] move db call to get admin id before mutation --- backend/src/seeds/factory/creation.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/seeds/factory/creation.ts b/backend/src/seeds/factory/creation.ts index 92bc224f6..980e0b3af 100644 --- a/backend/src/seeds/factory/creation.ts +++ b/backend/src/seeds/factory/creation.ts @@ -15,13 +15,13 @@ export const creationFactory = async ( ): Promise => { 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