Fix json_encode issue with decimal / integer encoding #162

This commit is contained in:
Kendrick Chan 2018-08-10 23:00:47 +08:00
parent 7237441ec3
commit 0a476f245a

View file

@ -2,7 +2,7 @@
namespace App\Ramcar;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
class APIResult
{
@ -68,7 +68,8 @@ class APIResult
'data' => $this->data
];
$json = new JsonResponse($return_data);
$json_data = json_encode($return_data, JSON_NUMERIC_CHECK);
$json = new Response($json_data);
return $json;
}