Skip to content

Commit

Permalink
Add new entity action to check for existing post action.
Browse files Browse the repository at this point in the history
  • Loading branch information
kuzmany committed Feb 20, 2024
1 parent 818a27b commit b371540
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/bundles/FormBundle/Controller/Api/FormApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,4 +327,16 @@ protected function createFieldEntityForm($entity)
]
);
}

public function newEntityAction(Request $request): Response
{
// Check for an email to see if the lead already exists
$parameters = $request->request->all();

if (!isset($parameters['postAction'])) {
$request->request->add(['postAction' => 'return']);
}

return parent::newEntityAction($request);
}
}

0 comments on commit b371540

Please sign in to comment.