Adding values to tags
Closed this issue ยท 2 comments
xeruf commented
Hey ๐ I am trying to get back into Haskell via IHP and want to add values to tags. I added a form field and managed to extract them, but how do I put them together when building a record?
action CreateTaskAction = do
let task = newRecord @Task
let names :: [Text] = paramList "tags_name"
let values :: [Text] = paramList "tags_value"
let tags = names |> map (buildTag newRecord)
mpscholten commented
You can try sometihng like let namesAndValues :: [(Text, Text)] = zip names values
and then let tags = namesAndValues |> map (buildTag newRecord)
And then adjust the buildTag
like this buildTag (name, value) tag = ...
xeruf commented
I think I managed, thanks :) https://forge.ftt.gmbh/janek/compareware/commit/f87cf81d24ab7de0f291e0d0e25c806bc130471b