mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-31 12:09:17 +08:00
Update GET /teams, GET teams/:team_id endpoints slightly
This commit is contained in:
parent
7b5a65416a
commit
6faaff550b
2 changed files with 4 additions and 1 deletions
|
@ -13,7 +13,9 @@ module Api
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
render jsonapi: @team, serializer: TeamSerializer
|
render jsonapi: @team,
|
||||||
|
serializer: TeamSerializer,
|
||||||
|
include: :created_by
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -4,6 +4,7 @@ module Api
|
||||||
module V1
|
module V1
|
||||||
class TeamSerializer < ActiveModel::Serializer
|
class TeamSerializer < ActiveModel::Serializer
|
||||||
attributes :id, :name, :description, :space_taken
|
attributes :id, :name, :description, :space_taken
|
||||||
|
belongs_to :created_by, serializer: UserSerializer
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue