hope everyone is doing great! i am new here and i have this list of structs rendered on my liveview
[%Apollo.Accounts.Schema.ImportedEmailStatu{
id: 14,
imported_email_id: 37,
inserted_at: ~N[2019-06-06 07:17:11],
job_id: 1,
status: "matched",
updated_at: ~N[2019-06-06 07:17:11],
children: []
},
%Apollo.Accounts.Schema.ImportedEmailStatu{
id: 15,
imported_email_id: 37,
inserted_at: ~N[2019-06-06 07:17:11],
job_id: 1,
status: "matched",
updated_at: ~N[2019-06-06 07:17:11],
children: []
},
%Apollo.Accounts.Schema.ImportedEmailStatu{
id: 16,
imported_email_id: 37,
inserted_at: ~N[2019-06-06 07:17:11],
job_id: 1,
status: "unmatched",
updated_at: ~N[2019-06-06 07:17:11],
children: []
}]
i want to render this in a nice way. I tried turning this into a map like this, which in my opinion not the best way to do it(i don’t want to manually rewrite all the attributes):
list =
# Tesla http client
# client
# |> API.get_accounts()
# |> Enum.map(& &1.id)
# list |> Enum.group_by(
# & &1.id,
# &%{
# "id" => &1.id,
# "status" => &1.status,
# "updated_at" => &1.updated_at,
# "due_at" => &1.due_at,
# "children" => &1.children
# }
# )
but i get this error: 1st argument: not an atom
TLDR: i want to render list of structs into an HTML table
thank you for your reply in advance .