[fix #4181] add service to procedure API

This commit is contained in:
pedong 2019-09-09 16:18:42 +02:00 committed by Pierre de La Morinerie
parent a32ac46492
commit 25596ca2f2
3 changed files with 26 additions and 1 deletions

View file

@ -17,6 +17,7 @@ class ProcedureSerializer < ActiveModel::Serializer
has_many :types_de_champ, serializer: TypeDeChampSerializer
has_many :types_de_champ_private, serializer: TypeDeChampSerializer
has_many :types_de_piece_justificative
belongs_to :service, serializer: ServiceSerializer
def archived_at
object.archived_at&.in_time_zone('UTC')

View file

@ -0,0 +1,9 @@
class ServiceSerializer < ActiveModel::Serializer
attributes :id, :siret, :email
attribute :nom, key: :name
attribute :type_organisme, key: :type_organization
attribute :organisme, key: :organization
attribute :telephone, key: :phone
attribute :horaires, key: :schedule
attribute :adresse, key: :address
end