about summary refs log tree commit diff
path: root/app/controllers/api
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-03-28 18:35:25 +0100
committerThibaut Girka <thib@sitedethib.com>2019-03-28 18:35:25 +0100
commitce7d055d3cc7927a597c8bb56b45f8e0aae91319 (patch)
tree4ba415e02d601654867889da11391b509909635d /app/controllers/api
parentbb316faffff7a76bc89f7e942233f0e14caf60f5 (diff)
parent58667072d9923b17c90543550294aa9f801103d7 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/v1/accounts/identity_proofs_controller.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/controllers/api/v1/accounts/identity_proofs_controller.rb b/app/controllers/api/v1/accounts/identity_proofs_controller.rb
new file mode 100644
index 000000000..bea51ae11
--- /dev/null
+++ b/app/controllers/api/v1/accounts/identity_proofs_controller.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class Api::V1::Accounts::IdentityProofsController < Api::BaseController
+  before_action :require_user!
+  before_action :set_account
+
+  respond_to :json
+
+  def index
+    @proofs = @account.identity_proofs.active
+    render json: @proofs, each_serializer: REST::IdentityProofSerializer
+  end
+
+  private
+
+  def set_account
+    @account = Account.find(params[:account_id])
+  end
+end