Skip to content

Commit

Permalink
Fixing controller issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ancarebeca committed Aug 23, 2015
1 parent d7b7cb4 commit 1b746db
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Controller/CalendarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ public function loadAction(Request $request)
$startDate = new \DateTime($request->get('start'));
$endDate = new \DateTime($request->get('end'));
$filters = $request->get('filters', []);
$content = [];

try {
$content = $this
->get('anca_rebeca_full_calendar.service.calendar')
->getData($startDate, $endDate, $filters);
$status = empty($content) ? Response::HTTP_NO_CONTENT : Response::HTTP_OK;
} catch (\Exception $exception) {
$content = '';
$status = Response::HTTP_INTERNAL_SERVER_ERROR;
}

Expand Down
2 changes: 1 addition & 1 deletion Event/CalendarEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CalendarEvent extends Event
/**
* @var EventInterface[]
*/
protected $events;
protected $events = [];

/**
* @param \Datetime $star
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ $(function () {
eventDurationEditable: true,
eventSources: [
{
url: /your/custom/route,
url: /full-calendar/load,
type: 'POST',
data: {
filters: { param: foo }
}
error: function() {
//alert()
Expand Down
3 changes: 1 addition & 2 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ services:

anca_rebeca_full_calendar.service.calendar:
class: AncaRebeca\FullCalendarBundle\Service\Calendar
public: false
arguments:
- @event_dispatcher
- @anca_rebeca_full_calendar.service.serializer
- @event_dispatcher

0 comments on commit 1b746db

Please sign in to comment.