How do I use a Union type as an action argument?
Given the following module and union type:
... how am I supposed to provide input to that
SubscriptionPlan.add_features
function?
The following all blow up:
I think I've tried all those variations with string keys as well. I'm not even getting to the manual action before I keep getting this error:
Or sometimes the message is just "is invalid". Help?7 Replies
You should just be able to pass in integers
Oh
Solution
You can't use the tag/tag value for types that aren't maps
Because there is nowhere to put the tag in
You don't need the tag or tag value for integers generally
Hmmmmm. Gonna play around with making it a map. I do need the tags because the union has multiple integer types
Or maybe I can just do tuples ...
{:installations, 2}
You could do tuples or maps, yes
Actually just removing the tag and tag_value totally fixed it
Now I have %{type: :installations, value: 1} which is exactly what I wanted!
🥳