Revert "fix: [API] Use restresponse to view an added event via /events/add"

This reverts commit 66037a36c5.
pull/4075/head
iglocska 2019-01-31 14:17:45 +01:00
parent 91b8be517c
commit 41e7474a30
1 changed files with 5 additions and 2 deletions

View File

@ -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'));