issues/27: old meta with pagination and trait and more
This commit is contained in:
committed by
Valeriy Petrov
parent
bc5468e5a0
commit
656f79ff4e
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Service\Crud;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use JsonException;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -142,9 +143,11 @@ final class CrudResponder
|
||||
*/
|
||||
private function decodePayload(Request $request): ?array
|
||||
{
|
||||
$data = json_decode($request->getContent(), true);
|
||||
|
||||
return is_array($data) ? $data : null;
|
||||
try {
|
||||
return $request->toArray();
|
||||
} catch (JsonException) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private function validate(object $entity): ?JsonResponse
|
||||
|
||||
Reference in New Issue
Block a user