chg: [galaxies:delete] Allow deletion by uuid

pull/6120/head
mokaddem 2020-06-09 09:36:47 +02:00
parent 9511f7151c
commit ea9e2fba77
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 4 additions and 1 deletions

View File

@ -114,9 +114,12 @@ class GalaxiesController extends AppController
public function delete($id)
{
if (!is_numeric($id)) {
if (Validation::uuid($id)) {
$id = $this->Toolbox->findIdByUuid($this->Galaxy, $id);
} elseif (!is_numeric($id)) {
throw new NotFoundException('Invalid galaxy.');
}
$galaxy = $this->Galaxy->find('first', array(
'recursive' => -1,
'conditions' => array('Galaxy.id' => $id)