mirror of https://github.com/MISP/MISP
Revert "fix: [API] Use restresponse to view an added event via /events/add"
This reverts commit 66037a36c5
.
pull/4075/head
parent
91b8be517c
commit
41e7474a30
|
@ -1655,10 +1655,13 @@ class EventsController extends AppController
|
|||
}
|
||||
// REST users want to see the newly created event
|
||||
$results = $this->Event->fetchEvent($this->Auth->user(), array('eventid' => $created_id));
|
||||
$event = $results[0];
|
||||
if (!empty($validationErrors)) {
|
||||
$results[0]['errors'] = $validationErrors;
|
||||
$event['errors'] = $validationErrors;
|
||||
}
|
||||
return $this->RestResponse->viewData($results[0], $this->response->type());
|
||||
$this->set('event', $event);
|
||||
$this->render('view');
|
||||
return true;
|
||||
} else {
|
||||
// redirect to the view of the newly created event
|
||||
$this->Flash->success(__('The event has been saved'));
|
||||
|
|
Loading…
Reference in New Issue