From ae1fac006206ab28cd7cba63ab85c07a27f3d606 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 5 Sep 2016 17:46:36 +0200 Subject: Add API to upload media attachments --- app/controllers/api/media_controller.rb | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 app/controllers/api/media_controller.rb (limited to 'app/controllers') diff --git a/app/controllers/api/media_controller.rb b/app/controllers/api/media_controller.rb new file mode 100644 index 000000000..d5a0a124a --- /dev/null +++ b/app/controllers/api/media_controller.rb @@ -0,0 +1,8 @@ +class Api::MediaController < ApiController + before_action :doorkeeper_authorize! + respond_to :json + + def create + @media = MediaAttachment.create!(account: current_user.account, file: params[:file]) + end +end -- cgit