mirror of https://github.com/MISP/MISP
Merge pull request #5021 from zaphodef/feature/return_sighting_add_rest
chg: Return the sighting when adding one through REST APIpull/5031/head
commit
69885806b0
|
@ -90,8 +90,8 @@ class SightingsController extends AppController
|
|||
}
|
||||
} else {
|
||||
if ($this->_isRest() || $this->response->type() === 'application/json') {
|
||||
$this->set('message', __('Sighting added'));
|
||||
$this->set('_serialize', array('message'));
|
||||
$sighting = $this->Sighting->find('first', array('conditions' => array('Sighting.id' => $this->Sighting->id), 'recursive' => -1));
|
||||
return $this->RestResponse->viewData($sighting, $this->response->type());
|
||||
} else {
|
||||
$this->Flash->success(__('Sighting added'));
|
||||
$this->redirect($this->referer());
|
||||
|
|
Loading…
Reference in New Issue