Updated media attachment on create to always include account param

This commit is contained in:
mgabdev 2019-09-17 01:13:02 -04:00
parent 956c06ea59
commit 6b4969dbdd

View File

@ -10,7 +10,7 @@ class Api::V1::MediaController < Api::BaseController
respond_to :json
def create
@media = current_account.media_attachments.create!(media_params)
@media = current_account.media_attachments.create!(account: current_account, file: media_params[:file], description: media_params[:description], focus: media_params[:focus])
render json: @media, serializer: REST::MediaAttachmentSerializer
rescue Paperclip::Errors::NotIdentifiedByImageMagickError
render json: file_type_error, status: 422