feat: preserve grounded sector ideas through private investment dossiers in QA
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
|
||||
use App\Services\InvestorPath;
|
||||
use App\Services\LegacyContent;
|
||||
use App\Services\PublicSearchMetrics;
|
||||
use App\Services\SectorContentAnalysis;
|
||||
use App\Services\VirtualDesk;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
@@ -40,12 +41,19 @@ class LegacyContentController extends Controller
|
||||
abort_unless($path->available(), 404);
|
||||
$article = $legacy->article($legacySlug);
|
||||
|
||||
return Inertia::render('investor-path/index', ['contexts' => $path->contexts($request->user()), 'contentSource' => $article]);
|
||||
$analysis = app(SectorContentAnalysis::class)->selection($article, $request->all());
|
||||
|
||||
return Inertia::render('investor-path/index', ['contexts' => $path->contexts($request->user()), 'contentSource' => $article, 'sectorIdea' => $analysis, 'analysisAction' => $request->query('analysis_action') === 'compare' ? 'compare' : 'prepare']);
|
||||
}
|
||||
|
||||
public function attach(Request $request, string $id, LegacyContent $legacy): JsonResponse|RedirectResponse
|
||||
{
|
||||
$legacy->attach($request->user(), $id, $request->all());
|
||||
$analysis = app(SectorContentAnalysis::class)->attach($request->user(), $id, $request->all());
|
||||
if ($analysis) {
|
||||
$href = app(SectorContentAnalysis::class)->continuation($id, $analysis);
|
||||
|
||||
return $request->expectsJson() ? response()->json(['saved' => true, 'continue' => $href]) : redirect($href);
|
||||
}
|
||||
|
||||
return $request->expectsJson() ? response()->json(['saved' => true]) : redirect('/investimentos/'.$id)->with('success', 'Referência guardada no dossier.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user