fix(api-v1): piece justificative serialization
This commit is contained in:
parent
1f8d28c678
commit
3affd1660f
1 changed files with 9 additions and 7 deletions
|
@ -46,13 +46,15 @@ class PiecesJustificativesService
|
|||
|
||||
def self.serialize_champs_as_pjs(dossier)
|
||||
dossier.champs_public.filter { |champ| champ.type_de_champ.old_pj }.map do |champ|
|
||||
{
|
||||
created_at: champ.created_at&.in_time_zone('UTC'),
|
||||
type_de_piece_justificative_id: champ.type_de_champ.old_pj[:stable_id],
|
||||
content_url: champ.for_api,
|
||||
user: champ.dossier.user
|
||||
}
|
||||
end
|
||||
champ.for_api&.map do |content_url|
|
||||
{
|
||||
created_at: champ.created_at&.in_time_zone('UTC'),
|
||||
type_de_piece_justificative_id: champ.type_de_champ.old_pj[:stable_id],
|
||||
content_url:,
|
||||
user: champ.dossier.user
|
||||
}
|
||||
end
|
||||
end.flatten
|
||||
end
|
||||
|
||||
def self.clone_attachments(original, kopy)
|
||||
|
|
Loading…
Reference in a new issue