Fix #5208: The posts version of create or update artist commentary endpoint does not work without the post ID parameter being passed in the body
Fix /posts/:post_id/artist_commentary/create_or_update not working without passing `artist_commentary[post_id]` in the form body.
This commit is contained in:
@@ -26,7 +26,7 @@ class ArtistCommentariesController < ApplicationController
|
||||
end
|
||||
|
||||
def create_or_update
|
||||
post_id = params[:artist_commentary].delete(:post_id)
|
||||
post_id = params[:artist_commentary].delete(:post_id) || params[:post_id]
|
||||
@artist_commentary = authorize ArtistCommentary.find_or_initialize_by(post_id: post_id)
|
||||
@artist_commentary.update(permitted_attributes(@artist_commentary))
|
||||
respond_with(@artist_commentary)
|
||||
|
||||
Reference in New Issue
Block a user