Introduce a "Save" button for the admin schedule

The changes were saved after you drop an event, and now it only saves the schedule when you're done with the changes and click the "Save" button.
This commit is contained in:
Ana 2016-07-22 17:57:26 +02:00
parent 2d95cd05ff
commit 99f71497cc
3 changed files with 52 additions and 37 deletions

View file

@ -4,17 +4,17 @@ module Admin
def create
event_schedule = EventSchedule.create(get_event_schedule_params(params))
render json: { 'status' => 'ok', event_schedule_id: event_schedule.id }
render json: { 'status' => 'ok', event: event_schedule.event.guid, event_schedule_id: event_schedule.id }
end
def update
@event_schedule.update(get_event_schedule_params(params))
render json: { 'status' => 'ok', event_schedule_id: @event_schedule.id }
render json: { 'status' => 'ok', event: @event_schedule.event.guid, event_schedule_id: @event_schedule.id }
end
def destroy
@event_schedule.destroy if @event_schedule
render json: { 'status' => 'ok' }
render json: { 'status' => 'ok', event: @event_schedule.event.guid }
end
private