Use Doctrine in Form create
[MAILPOET-3037]
This commit is contained in:
@ -168,9 +168,11 @@ class Forms extends APIEndpoint {
|
|||||||
$formEntity = $this->formFactory->createEmptyForm();
|
$formEntity = $this->formFactory->createEmptyForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
$form = Form::findOne($formEntity->getId());
|
$form = $this->formsRepository->findOneById($formEntity->getId());
|
||||||
if(!$form instanceof Form) return $this->errorResponse();
|
if ($form instanceof FormEntity) {
|
||||||
return $this->successResponse($form->asArray());
|
return $this->successResponse($this->formsResponseBuilder->build($form));
|
||||||
|
}
|
||||||
|
return $this->errorResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function previewEditor($data = []) {
|
public function previewEditor($data = []) {
|
||||||
|
Reference in New Issue
Block a user