File size: 469 Bytes
3206347
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { renderObject } from '../../../../helpers/renderer.js';

export default async (request, response) => {
  const step = await request.currentUser.authorizedSteps
    .clone()
    .where('steps.id', request.params.stepId)
    .whereNotNull('steps.app_key')
    .first()
    .throwIfNotFound();

  const dynamicFields = await step.createDynamicFields(
    request.body.dynamicFieldsKey,
    request.body.parameters
  );

  renderObject(response, dynamicFields);
};