Compare commits

...

2 Commits

Author SHA1 Message Date
9e0e9ea2ae fix ammo group create not handling invalid attrs 2022-02-18 18:49:11 -05:00
2a0f5720ee fix confusing placeholder 2022-02-18 18:41:45 -05:00
2 changed files with 7 additions and 2 deletions
lib
cannery
cannery_web/live/ammo_type_live

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

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