add visibility for all responses from Projects API

This commit is contained in:
Vokhmin Alexey V 2015-02-19 22:28:51 +03:00
parent 264462afc6
commit 8a4351850c
8 changed files with 6 additions and 8 deletions

View File

@ -1,2 +1,2 @@
json.(platform, :id, :name)
json.(platform, :id, :name, :visibility, :platform_type)
json.url api_v1_platform_path(platform.id, format: :json)

View File

@ -1,6 +1,5 @@
json.platforms @platforms do |platform|
json.partial! 'platform', platform: platform
json.(platform, :platform_type, :visibility)
json.partial! 'api/v1/shared/owner', owner: platform.owner
json.repositories platform.repositories do |repo|
json.(repo, :id, :name)

View File

@ -1,6 +1,6 @@
json.platform do
json.partial! 'platform', platform: @platform
json.(@platform, :description, :parent_platform_id, :released, :visibility, :platform_type, :distrib_type)
json.(@platform, :description, :parent_platform_id, :released, :distrib_type)
json.created_at @platform.created_at.to_i
json.updated_at @platform.updated_at.to_i
json.partial! 'api/v1/shared/owner', owner: @platform.owner

View File

@ -1,4 +1,4 @@
json.(project, :id, :name)
json.(project, :id, :name, :visibility)
json.fullname project.name_with_owner
json.url api_v1_project_path(project.id, format: :json)
json.git_url git_repo_url(project.name_with_owner)

View File

@ -1,5 +1,4 @@
json.project do
json.partial! 'project', project: @project
json.(@project, :visibility)
json.partial! 'api/v1/shared/owner', owner: @project.owner
end

View File

@ -1,6 +1,6 @@
json.projects @projects do |project|
json.partial! 'project', project: project
json.(project, :visibility, :description, :ancestry, :has_issues, :has_wiki, :default_branch, :is_package, :publish_i686_into_x86_64)
json.(project, :description, :ancestry, :has_issues, :has_wiki, :default_branch, :is_package, :publish_i686_into_x86_64)
json.created_at project.created_at.to_i
json.updated_at project.updated_at.to_i
json.partial! 'api/v1/shared/owner', owner: project.owner

View File

@ -1,6 +1,6 @@
json.project do
json.partial! 'project', project: @project
json.(@project, :visibility, :description, :ancestry, :has_issues, :has_wiki, :default_branch, :is_package, :publish_i686_into_x86_64)
json.(@project, :description, :ancestry, :has_issues, :has_wiki, :default_branch, :is_package, :publish_i686_into_x86_64)
json.created_at @project.created_at.to_i
json.updated_at @project.updated_at.to_i
json.partial! 'api/v1/shared/owner', owner: @project.owner

View File

@ -31,7 +31,7 @@ Rosa::Application.routes.draw do
}, skip: [:registrations]
namespace :api do
namespace :v1 do
namespace :v1, constraints: { format: 'json' }, defaults: { format: 'json' } do
resources :advisories, only: [:index, :show, :create, :update]
resources :search, only: [:index]
resources :build_lists, only: [:index, :create, :show] do