mirror of https://github.com/mastodon/mastodon
Reuse existing controller and route
parent
8bd8ea7c04
commit
94e213c6c1
@ -1,18 +0,0 @@
|
|||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class Api::Activitypub::AccountsController < ApiController
|
|
||||||
before_action :set_account
|
|
||||||
|
|
||||||
respond_to :'application/activity+json'
|
|
||||||
respond_to :'application/ld+json; profile="https://www.w3.org/ns/activitystreams#"'
|
|
||||||
|
|
||||||
def show
|
|
||||||
render content_type: :'application/ld+json; profile="https://www.w3.org/ns/activitystreams#"'
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def set_account
|
|
||||||
@account = Account.find(params[:id])
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,8 +1,7 @@
|
|||||||
|
extends 'activitypub/types/person.rabl'
|
||||||
|
|
||||||
object @account
|
object @account
|
||||||
|
|
||||||
node(:'@context') { 'https://www.w3.org/ns/activitystreams' }
|
|
||||||
node(:type) { 'Person' }
|
|
||||||
node(:id) { request.original_url }
|
|
||||||
node(:url) { |account| TagManager.instance.url_for(account) }
|
node(:url) { |account| TagManager.instance.url_for(account) }
|
||||||
node(:name) { |account| account.display_name }
|
node(:name) { |account| account.display_name }
|
||||||
node(:preferredUsername) { |account| account.username }
|
node(:preferredUsername) { |account| account.username }
|
@ -0,0 +1 @@
|
|||||||
|
node(:'@context') { 'https://www.w3.org/ns/activitystreams' }
|
@ -0,0 +1,3 @@
|
|||||||
|
extends 'activitypub/base.rabl'
|
||||||
|
|
||||||
|
node(:id) { request.original_url }
|
@ -0,0 +1,3 @@
|
|||||||
|
extends 'activitypub/intransient.rabl'
|
||||||
|
|
||||||
|
node(:type) { 'Person' }
|
Loading…
Reference in New Issue