Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Commit

Permalink
in Controller::DatacenterRack#update, if the user provides a "role" p…
Browse files Browse the repository at this point in the history
…arameter, map it to the new db field name

(cherry picked from commit 2ae002c)
  • Loading branch information
sungo committed Sep 7, 2018
1 parent fd83fd3 commit 701fa8b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Conch/Controller/DatacenterRack.pm
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ sub update ($c) {
}
}

if ($input->{role}) {
unless ($c->db_datacenter_rack_roles->search({ id => $input->{role} })->count) {
if (exists $input->{role}) {
if ($c->db_datacenter_rack_roles->search({ id => $input->{role} })->count) {
$input->{datacenter_rack_role_id} = delete $input->{role};
} else {
return $c->status(400 => { "error" => "Rack role does not exist" });
}
}
Expand Down

0 comments on commit 701fa8b

Please sign in to comment.