]>
cat aescling's git repositories - mastodon.git/blob - app/controllers/api/v1/reports_controller.rb
1 # frozen_string_literal: true
3 class Api
::V1::ReportsController < ApiController
4 before_action
-> { doorkeeper_authorize!
:read }, except
: [:create]
5 before_action
-> { doorkeeper_authorize!
:write }, only
: [:create]
6 before_action
:require_user!
11 @reports = Report
.where(account
: current_account
)
15 status_ids
= params
[:status_ids].is_a
?(Enumerable
) ? params
[:status_ids] : [params
[:status_ids]]
17 @report = Report
.create!
(account
: current_account
,
18 target_account
: Account
.find(params
[:account_id]),
19 status_ids
: Status
.find(status_ids
).pluck(:id),
20 comment
: params
[:comment])
This page took 0.079083 seconds and 4 git commands to generate.