fix helper responsejson

This commit is contained in:
Muhammad Fajar
2022-11-07 11:21:27 +07:00
parent 72194d7c42
commit f2103baeb5

View File

@@ -161,7 +161,7 @@ class Helper
public static function responseJson(array|object $data = [], int $statusCode = Response::HTTP_OK, string $message = 'Data berhasil di ambil'): JsonResponse
{
return response()->json([
'status' => $statusCode != 200 ? 'error' : 'success',
'status' => in_array($statusCode, [200, 201, 204]) ? 'success' : 'error',
'statusCode' => $statusCode,
'message' => $message,
'data' => $data,