docbrown/app/controllers/api/v0/organizations_controller.rb
Spencer c0168df2a8
API: Endpoint to get an organization's details (#10931)
* add organizations api request spec

* add organizations api controller

* add organizations api show route

* add show jbuilder file

* fix merge conflict on routes

* add organization show to api docs

* update created_at to iso format

* api docs add format field/cleanup
2020-10-30 16:22:30 -04:00

16 lines
503 B
Ruby

module Api
module V0
class OrganizationsController < ApiController
SHOW_ATTRIBUTES_FOR_SERIALIZATION = %i[
username name summary twitter_username github_username url
location created_at profile_image tech_stack tag_line story
].freeze
private_constant :SHOW_ATTRIBUTES_FOR_SERIALIZATION
def show
@organization = Organization.select(SHOW_ATTRIBUTES_FOR_SERIALIZATION)
.find_by!(username: params[:org_username])
end
end
end
end