Skip to content

Commit

Permalink
Allow for removal of last power on a rank
Browse files Browse the repository at this point in the history
  • Loading branch information
AW0005 authored Jan 9, 2024
1 parent 5db813e commit b8297b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Services/RankService.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ public function updateRank($rank, $data, $user) {
$data['icon'] ??= 'fas fa-user';

$rank->update($data);
$rank->powers()->delete();
if ($powers) {
$rank->powers()->delete();
foreach ($powers as $power) {
DB::table('rank_powers')->insert(['rank_id' => $rank->id, 'power' => $power]);
}
Expand Down

0 comments on commit b8297b5

Please sign in to comment.