about summary refs log tree commit diff
path: root/app/controllers/api/v1/media_controller.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-02-10 19:09:27 +0100
committerClaire <claire.github-309c@sitedethib.com>2022-02-10 19:09:27 +0100
commitf1a6f9062e00c0651680bf4d5d750ec0b078ac5a (patch)
tree30d40f0b5df56e955f80a91ae3b44090bd918ed9 /app/controllers/api/v1/media_controller.rb
parentd602c92b310545eb733a58caed49717341abe27c (diff)
parent3dc1e3cfc3928ce709c3e60e98ecbd1edd6e2a7d (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `app/controllers/api/v1/statuses_controller.rb`:
  Upstream moved things around in a place where glitch-soc had support for
  an extra parameter (`content_type`).
  Follow upstream but reintroduce `content_type`.
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