Compare commits

..

2 Commits

Author SHA1 Message Date
9e0e9ea2ae fix ammo group create not handling invalid attrs
Some checks failed
continuous-integration/drone/push Build is failing
2022-02-18 18:49:11 -05:00
2a0f5720ee fix confusing placeholder
Some checks reported errors
continuous-integration/drone/push Build was killed
2022-02-18 18:41:45 -05:00
2 changed files with 7 additions and 2 deletions

View File

@ -256,6 +256,12 @@ defmodule Cannery.Ammo do
|> Repo.insert() |> Repo.insert()
end end
def create_ammo_group(invalid_attrs, _user) do
%AmmoGroup{}
|> AmmoGroup.create_changeset(invalid_attrs |> Map.put("user_id", "-1"))
|> Repo.insert()
end
@doc """ @doc """
Updates a ammo_group. Updates a ammo_group.

View File

@ -98,8 +98,7 @@
class: "mr-4 title text-lg text-primary-600" class: "mr-4 title text-lg text-primary-600"
) %> ) %>
<%= text_input(f, :powder_type, <%= text_input(f, :powder_type,
class: "text-center col-span-2 input input-primary", class: "text-center col-span-2 input input-primary"
placeholder: gettext("Brass")
) %> ) %>
<%= error_tag(f, :powder_type, "col-span-3 text-center") %> <%= error_tag(f, :powder_type, "col-span-3 text-center") %>