Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
ffe48fd7
Commit
ffe48fd7
authored
9 years ago
by
Eugen Rochko
Browse files
Options
Downloads
Patches
Plain Diff
Improving how the API responses look
parent
ab6696e8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/views/api/accounts/show.rabl
+6
-5
6 additions, 5 deletions
app/views/api/accounts/show.rabl
app/views/api/follows/show.rabl
+2
-5
2 additions, 5 deletions
app/views/api/follows/show.rabl
app/views/api/statuses/show.rabl
+7
-7
7 additions, 7 deletions
app/views/api/statuses/show.rabl
with
15 additions
and
17 deletions
app/views/api/accounts/show.rabl
+
6
−
5
View file @
ffe48fd7
...
...
@@ -2,8 +2,9 @@ object @account
attributes :id, :username, :acct, :display_name, :note
node(:url) { |account| url_for_target(account) }
node(:avatar) { |account| asset_url(account.avatar.url(:large, false)) }
node(:followers) { |account| account.followers.count }
node(:following) { |account| account.following.count }
node(:statuses) { |account| account.statuses.count }
node(:url) { |account| url_for_target(account) }
node(:avatar) { |account| asset_url(account.avatar.url(:large, false)) }
node(:followers_count) { |account| account.followers.count }
node(:following_count) { |account| account.following.count }
node(:statuses_count) { |account| account.statuses.count }
node(:following) { |account| current_user.account.following?(account) }
This diff is collapsed.
Click to expand it.
app/views/api/follows/show.rabl
+
2
−
5
View file @
ffe48fd7
object @follow
child :target_account => :target_account do
extends('api/accounts/show')
end
object @follow.target_account
extends('api/accounts/show')
This diff is collapsed.
Click to expand it.
app/views/api/statuses/show.rabl
+
7
−
7
View file @
ffe48fd7
object @status
attributes :id, :created_at, :in_reply_to_id
node(:uri) { |status| uri_for_target(status) }
node(:content) { |status| status.local? ? linkify(status) : status.content }
node(:url) { |status| url_for_target(status) }
node(:reblogs) { |status| status.reblogs.count }
node(:favourites) { |status| status.favourites.count }
node(:favourited) { |status| current_user.account.favourited?(status) }
node(:reblogged) { |status| current_user.account.reblogged?(status) }
node(:uri)
{ |status| uri_for_target(status) }
node(:content)
{ |status| status.local? ? linkify(status) : status.content }
node(:url)
{ |status| url_for_target(status) }
node(:reblogs
_count
) { |status| status.reblogs.count }
node(:favourites
_count
) { |status| status.favourites.count }
node(:favourited)
{ |status| current_user.account.favourited?(status) }
node(:reblogged)
{ |status| current_user.account.reblogged?(status) }
child :reblog => :reblog do
extends('api/statuses/show')
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment