2 - Fix scenario resource data wrapper in Inertia props
This commit is contained in:
parent
e5a02c3c32
commit
618d674793
2 changed files with 3 additions and 3 deletions
|
|
@ -44,7 +44,7 @@ public function show(Scenario $scenario): Response
|
|||
}]);
|
||||
|
||||
return Inertia::render('Scenarios/Show', [
|
||||
'scenario' => new ScenarioResource($scenario),
|
||||
'scenario' => ScenarioResource::make($scenario)->resolve(),
|
||||
'buckets' => BucketResource::collection($scenario->buckets),
|
||||
'streams' => StreamResource::collection($this->streamRepository->getForScenario($scenario)),
|
||||
'streamStats' => $this->statsService->getSummaryStats($scenario),
|
||||
|
|
@ -66,7 +66,7 @@ public function store(StoreScenarioRequest $request): RedirectResponse
|
|||
public function edit(Scenario $scenario): Response
|
||||
{
|
||||
return Inertia::render('Scenarios/Edit', [
|
||||
'scenario' => new ScenarioResource($scenario),
|
||||
'scenario' => ScenarioResource::make($scenario)->resolve(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public function share(Request $request): array
|
|||
'user' => $request->user(),
|
||||
],
|
||||
'sidebarOpen' => ! $request->hasCookie('sidebar_state') || $request->cookie('sidebar_state') === 'true',
|
||||
'scenario' => fn () => ($scenario = Scenario::first()) ? new ScenarioResource($scenario) : null,
|
||||
'scenario' => fn () => ($scenario = Scenario::first()) ? ScenarioResource::make($scenario)->resolve() : null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue