about summary refs log tree commit diff
path: root/app/controllers/api/v1/media_controller.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-02-10 00:15:30 +0100
committerGitHub <noreply@github.com>2022-02-10 00:15:30 +0100
commit63002cde03a836b4510aca5da564504ecaedb5e9 (patch)
treef6749dd6bafae30c8708559da037668f5585b16e /app/controllers/api/v1/media_controller.rb
parent20a3564ab280a004cc7c075c00f63e70b1d65e07 (diff)
Add editing for published statuses (#17320)
* Add editing for published statuses

* Fix change of multiple-choice boolean in poll not resetting votes

* Remove the ability to update existing media attachments for now
Diffstat (limited to 'app/controllers/api/v1/media_controller.rb')
-rw-r--r--app/controllers/api/v1/media_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/api/v1/media_controller.rb b/app/controllers/api/v1/media_controller.rb
index a2a919a3e..72094790f 100644
--- a/app/controllers/api/v1/media_controller.rb
+++ b/app/controllers/api/v1/media_controller.rb
@@ -20,7 +20,7 @@ class Api::V1::MediaController < Api::BaseController
   end
 
   def update
-    @media_attachment.update!(media_attachment_params)
+    @media_attachment.update!(updateable_media_attachment_params)
     render json: @media_attachment, serializer: REST::MediaAttachmentSerializer, status: status_code_for_media_attachment
   end
 
@@ -42,6 +42,10 @@ class Api::V1::MediaController < Api::BaseController
     params.permit(:file, :thumbnail, :description, :focus)
   end
 
+  def updateable_media_attachment_params
+    params.permit(:thumbnail, :description, :focus)
+  end
+
   def file_type_error
     { error: 'File type of uploaded media could not be verified' }
   end