I thought giving a simplified example would help. But the original list consists of a list of structs. And the I have written a function that accepts a single struct.
a single struct looks like this
%Post{
id : uuid,
name: some name,
feedbacks: [
%Comment{
........
},
%Comment{
........
}
]
}
So a list consists of
[
%Post{
id : uuid,
name: some name,
feedbacks: [
%Comment{
........
},
%Comment{
........
}
]
},
%Post{
id : uuid,
name: some name,
feedbacks: [
%Comment{
........
},
%Comment{
........
}
]
},
%Post{
id : uuid,
name: some name,
feedbacks: [
%Comment{
........
},
%Comment{
........
}
]
}
]
This is the function I have
def translate(%Post{} = post) do
post
|> Post.changeset(%{
feedbacks:
translate_feedbacks(
post.feedbacks
)
})
|> Ecto.Changeset.apply_changes()
Now, I want to be able to pass each struct in the list to this function.


















