chore: Introduce has many steps through flows for user model

This commit is contained in:
Faruk AYDIN
2022-01-29 19:48:59 +03:00
committed by Ömer Faruk Aydın
parent 700d0bfd32
commit 3429784309
5 changed files with 32 additions and 24 deletions

View File

@@ -23,17 +23,11 @@ const updateStepResolver = async (
) => {
const { input } = params;
const flow = await req.currentUser
.$relatedQuery('flows')
.findOne({
id: input.flow.id,
})
.throwIfNotFound();
let step = await flow
let step = await req.currentUser
.$relatedQuery('steps')
.findOne({
id: input.id,
'steps.id': input.id,
flow_id: input.flow.id,
})
.throwIfNotFound();