change response json
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Modules\Linksehat\Http\Controllers\Api;
|
||||
|
||||
use App\Helpers\Helper;
|
||||
use App\Models\Organization;
|
||||
use App\Models\Practice;
|
||||
use App\Models\PractitionerRole;
|
||||
@@ -32,14 +33,7 @@ class SearchController extends Controller
|
||||
->where('organization_id', $request->organization_id)
|
||||
->get(['persons.name AS person_name', 'specialities.name AS speciality_name', 'practitioner_id', 'practitioner_roles.id']);
|
||||
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'statusCode' => Response::HTTP_OK,
|
||||
'message' => 'Data Berhasil di ambil',
|
||||
'data' => [
|
||||
'doctors' => SpecialityResource::collection($doctors)
|
||||
]
|
||||
]);
|
||||
return Helper::responseJson(SpecialityResource::collection($doctors));
|
||||
}
|
||||
|
||||
public function searchHospital(Request $request)
|
||||
@@ -74,11 +68,6 @@ class SearchController extends Controller
|
||||
->groupBy(['practitioner_roles.organization_id', 'practitioner_roles.speciality_id'])
|
||||
->get();
|
||||
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'statusCode' => Response::HTTP_OK,
|
||||
'message' => 'Data rumah sakit berhasil di ambil',
|
||||
'data' => HospitalResource::collection($queryHospitals)
|
||||
]);
|
||||
return Helper::responseJson(data: HospitalResource::collection($queryHospitals), message: 'Data rumah sakit berhasil di ambil');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user