fix login & fix logout

This commit is contained in:
Muhammad Fajar
2022-12-07 02:37:18 +07:00
parent 723c9f1895
commit 2bac2bfeb7
7 changed files with 25 additions and 38 deletions

View File

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