dimitarvp

dimitarvp

Of course. Now show me a code snippet that’s doing it.

0
Post #21
roganjoshua

roganjoshua OP 

|> Enum.map(%{customer: map["value"]})
0
Post #22
dimitarvp

dimitarvp

Have you tried running that in iex? I don’t want you to just write what you think it is, I want you to try and run it as well.

0
Post #23
roganjoshua

roganjoshua OP 

 |> Map.get(:body) |> Enum.map(%{customer: map["value"]})
** (BadFunctionError) expected a function, got: %{customer: "EOG.Acme.ManualXML"}
    (elixir 1.15.7) lib/enum.ex:1693: Enum."-map/2-lists^map/1-1-"/2
    (elixir 1.15.7) lib/enum.ex:1693: Enum."-map/2-lists^map/1-1-"/2
0
Post #24
dimitarvp

dimitarvp

Yep. Can’t work.

How well do you know Elixir?

1
Post #25
roganjoshua

roganjoshua OP

I have never really seen it since a couple of weeks maybe a bit longer but only a couple of weeks of really trying

0
Post #26
dimitarvp

dimitarvp

Well that explains a lot.

Do you know what is the expected type of the 2nd argument to Enum.map?

0
Post #27
roganjoshua

roganjoshua OP

a function

0
Post #28
dimitarvp

dimitarvp

Yep. And %{customer: map["value"]} is not a function.

So what next?

Have you covered the official guide?

0
Post #29
roganjoshua

roganjoshua OP 

|> Enum.into( %{}, fn item -> {"Customer", item["value"]} end)
0
Post #30