improve code in controller and form request for V3 whit pint package
This commit is contained in:
@@ -30,12 +30,14 @@ class ProvinceOfficeController extends Controller
|
||||
allowedFilters: ['*'],
|
||||
allowedSortings: ['*'],
|
||||
);
|
||||
|
||||
return response()->json($data);
|
||||
|
||||
}
|
||||
|
||||
public function feedback(FeedBackRequest $request, Harim $harim): JsonResponse
|
||||
{
|
||||
DB::transaction(function () use ($request,$harim) {
|
||||
DB::transaction(function () use ($request, $harim) {
|
||||
$action = HarimAction::FEEDBACK->value;
|
||||
|
||||
$harim->histories()->create([
|
||||
@@ -49,12 +51,13 @@ class ProvinceOfficeController extends Controller
|
||||
|
||||
$state = HarimStates::BARESI_TAVASOT_DAFTAR_HARIM->value;
|
||||
|
||||
$harim ->update([
|
||||
$harim->update([
|
||||
'state_id' => $state,
|
||||
'state_name' => HarimStates::name($state),
|
||||
'forbidden_area' => $request->input('forbidden_area'),
|
||||
]);
|
||||
});
|
||||
|
||||
return $this->successResponse();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user