- WIP on lean-api visual
This commit is contained in:
1 parent
c5ec582bd1
commit
c9b107809d
6 files changed
+46
-36
No files matched your search
@@ -6,6 +6,7 @@ use Lean\Api\Factory\MessageFactoryInterface;
|
||||
use Lean\LanguageHandler;
|
||||
use Picea\Ui\Method\FormContextInterface;
|
||||
use Ulmus\Entity\EntityInterface;
|
||||
use Ulmus\EntityCollection;
|
||||
|
||||
trait FormTrait
|
||||
{
|
||||
@@ -29,7 +30,7 @@ trait FormTrait
|
||||
return $this->languageHandler->languageFromKey($key, $variables);
|
||||
}
|
||||
|
||||
public function getEntity() : EntityInterface
|
||||
public function getEntity() : EntityInterface|EntityCollection
|
||||
{
|
||||
if (! isset($this->entity)) {
|
||||
throw new \InvalidArgumentException($this->lang("lean.api.form.error.entity"));
|
||||
|
||||
@@ -33,11 +33,11 @@ class ApiRenderer implements MiddlewareInterface {
|
||||
'data' => [
|
||||
# 'error_id' => $errorId,
|
||||
'message' => $ex->getMessage(),
|
||||
] + (getenv('DEBUG') ? [
|
||||
'file' => $ex->getFile(),
|
||||
'line' => $ex->getLine(),
|
||||
'code' => $ex->getCode(),
|
||||
'backtrace' => $ex->getTrace(),
|
||||
]
|
||||
'backtrace' => $ex->getTrace(), ] : [])
|
||||
], 500);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user