Exige motivo na reversão territorial e prepara novo plano
This commit is contained in:
@@ -21,9 +21,10 @@ class InvestmentRelationshipRepairController extends Controller
|
||||
public function apply(Request $request, InvestmentRelationshipRepair $repair): RedirectResponse|JsonResponse
|
||||
{
|
||||
if ($request->input('operation') === 'traceability') {
|
||||
$data = $request->validate(['hash' => ['required', 'string', 'size:64'], 'reverse' => ['required', 'boolean']]);
|
||||
$data = $request->validate(['hash' => ['required', 'string', 'size:64'], 'reverse' => ['required', 'boolean'],
|
||||
'reason' => ['required_if:reverse,true', 'nullable', 'string', 'max:1000'], 'confirm_reverse' => ['accepted_if:reverse,true']]);
|
||||
try {
|
||||
$result = app(InvestmentTerritorialTraceability::class)->apply($data['hash'], $request->user()->id, $data['reverse']);
|
||||
$result = app(InvestmentTerritorialTraceability::class)->apply($data['hash'], $request->user()->id, $data['reverse'], $data['reason'] ?? null);
|
||||
} catch (HttpException $exception) {
|
||||
if ($request->expectsJson()) {
|
||||
throw $exception;
|
||||
|
||||
Reference in New Issue
Block a user