chg: [galaxyClusters] Returns created json blob instead of interface

response
pull/6120/head
mokaddem 2020-11-12 16:18:51 +01:00
parent 7ea735a5b1
commit 65f65adc1a
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 8 additions and 2 deletions

View File

@ -325,8 +325,11 @@ class GalaxyClustersController extends AppController
}
} else {
$message = __('Galaxy cluster saved');
if ($this->_isRest()) {
if ($this->request->is('ajax')) {
return $this->RestResponse->saveSuccessResponse('GalaxyCluster', 'add', $this->GalaxyCluster->id, $this->response->type());
} else if ($this->_isRest()) {
$saved_cluster = $this->GalaxyCluster->fetchIfAuthorized($this->Auth->user(), $this->GalaxyCluster->id, 'view', $throwErrors=true, $full=true);
return $this->RestResponse->viewData($saved_cluster);
} else {
$this->Flash->success($message);
$this->redirect(array('controller' => 'galaxy_clusters', 'action' => 'view', $this->GalaxyCluster->id));
@ -432,8 +435,11 @@ class GalaxyClustersController extends AppController
}
} else {
$message = __('Galaxy cluster saved');
if ($this->_isRest()) {
if ($this->request->is('ajax')) {
return $this->RestResponse->saveSuccessResponse('GalaxyCluster', 'edit', $cluster['GalaxyCluster']['id'], $this->response->type());
} else if ($this->_isRest()) {
$saved_cluster = $this->GalaxyCluster->fetchIfAuthorized($this->Auth->user(), $id, 'view', $throwErrors=true, $full=true);
return $this->RestResponse->viewData($saved_cluster);
} else {
$this->Flash->success($message);
$this->redirect(array('controller' => 'galaxy_clusters', 'action' => 'view', $this->GalaxyCluster->id));