zorn / flick

WIP. A simple Elixir / Phoenix LiveView app to help capture ranked votes.
https://flick-ysjm.onrender.com
MIT License
10 stars 2 forks source link

Revisit `map()` type for `attrs` function argument in `Ballots.create_ballot/2`. #4

Open zorn opened 6 months ago

zorn commented 6 months ago

With the work I am doing in #1 I am allowing for a very soft attrs type of map().

I'd prefer this type to be more specific, BUT since the payload is very dynamic and the keys I need to accept are strings, I'm not sure how to best approach this, and so I'm noting the concern here to come back to it.

  ballot_params #=> %{
    "questions" => %{
      "0" => %{"_persistent_id" => "0", "title" => "12"},
      "1" => %{"_persistent_id" => "1", "title" => "34"}
    },
    "questions_drop" => [""],
    "questions_sort" => ["0", "1"],
    "title" => "Lunch Survey123"
  }