Skip to content

Commit

Permalink
[BF] Check for patch panels when deleting racks [ref: 055-9-14]
Browse files Browse the repository at this point in the history
  • Loading branch information
barryo committed Oct 21, 2022
1 parent e5a48ab commit 5ec406e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/Http/Controllers/CabinetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ protected function preDelete(): bool
$okay = false;
}

if( ( $cnt = $this->object->patchPanels()->count() ) ) {
AlertContainer::push( "Could not delete the rack as at least one patch panel is located here. Reassign or delete the panel first.", Alert::DANGER );
$okay = false;
}


return $okay;
}

Expand Down

0 comments on commit 5ec406e

Please sign in to comment.