Skip to content

Commit

Permalink
fix: admin view elements on design updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ScuffedNewt committed Jul 16, 2024
1 parent 2357dca commit e082ab2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions resources/views/character/design/features.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,14 @@
->where('typing_id', $request->character->image->id)
->first();
// make newtype a clone of current type not a reference
$newType = $currentType ? clone $currentType : null;
if ($currentType) {
$newType->element_ids = json_encode($request->data['element_ids']);
$newType = $currentType ? clone $currentType : new \App\Models\Element\Typing();
if (!$currentType) {
$newType->typing_model = 'App\Models\Character\CharacterImage';
$newType->typing_id = $request->character->image->id;
$newType->element_ids = [];
}
if (isset($request->data['element_ids']) && $request->data['element_ids']) {
$newType->element_ids = $request->data['element_ids'];
}
@endphp
<h4 class="mt-3">Elements</h4>
Expand Down

0 comments on commit e082ab2

Please sign in to comment.