29 lines
954 B
PHP
29 lines
954 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Opportunity;
|
|
use App\Services\OpportunityPromotion;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Http\Request;
|
|
use Inertia\Inertia;
|
|
use Inertia\Response;
|
|
|
|
final class OpportunityPromotionController extends Controller
|
|
{
|
|
public function show(Request $request, int $id, OpportunityPromotion $service): Response
|
|
{
|
|
return Inertia::render('management/opportunity-promotion', $service->editor($request->user(), Opportunity::findOrFail($id)));
|
|
}
|
|
|
|
public function preview(Request $request, int $id, OpportunityPromotion $service): JsonResponse
|
|
{
|
|
return response()->json($service->preview($request->user(), Opportunity::findOrFail($id), $request->all()));
|
|
}
|
|
|
|
public function confirm(Request $request, int $id, OpportunityPromotion $service): JsonResponse
|
|
{
|
|
return response()->json($service->confirm($request->user(), $id, $request->all()));
|
|
}
|
|
}
|