Fix bug when no talks are selected
This commit is contained in:
parent
fc817e78b0
commit
579fd2c04f
|
@ -29,7 +29,7 @@ class TalkPreferencesController < ApplicationController
|
||||||
@talk_preference.transaction do
|
@talk_preference.transaction do
|
||||||
@talk_preference.selected_talks.destroy_all
|
@talk_preference.selected_talks.destroy_all
|
||||||
|
|
||||||
if @talk_preference.update talk_preference_params
|
if params[:talk_preference].blank? || @talk_preference.update(talk_preference_params)
|
||||||
render json: {
|
render json: {
|
||||||
update_url: talk_preference_url(@talk_preference),
|
update_url: talk_preference_url(@talk_preference),
|
||||||
hashed_uid: @talk_preference.hashed_unique_id,
|
hashed_uid: @talk_preference.hashed_unique_id,
|
||||||
|
|
Loading…
Reference in New Issue