Fix #52 - Add API versioning (v1)

This commit is contained in:
Eugen Rochko
2016-09-27 16:58:23 +02:00
parent 3f75f52285
commit 4f9b7432dd
53 changed files with 77 additions and 134 deletions

View File

@ -0,0 +1,2 @@
collection @followers
extends('api/v1/accounts/show')

View File

@ -0,0 +1,2 @@
collection @following
extends('api/v1/accounts/show')

View File

@ -0,0 +1,5 @@
object @account
attribute :id
node(:following) { |account| @following[account.id] || false }
node(:followed_by) { |account| @followed_by[account.id] || false }
node(:blocking) { |account| @blocking[account.id] || false }

View File

@ -0,0 +1,2 @@
collection @accounts
extends 'api/v1/accounts/relationship'

View File

@ -0,0 +1,10 @@
object @account
attributes :id, :username, :acct, :display_name, :note
node(:url) { |account| TagManager.instance.url_for(account) }
node(:avatar) { |account| full_asset_url(account.avatar.url(:large, false)) }
node(:header) { |account| full_asset_url(account.header.url(:medium, false)) }
node(:followers_count) { |account| account.followers.count }
node(:following_count) { |account| account.following.count }
node(:statuses_count) { |account| account.statuses.count }

View File

@ -0,0 +1,2 @@
collection @statuses
extends('api/v1/statuses/show')