fix ammo group create not handling invalid attrs

This commit is contained in:
shibao 2022-02-18 18:49:11 -05:00
parent 2a0f5720ee
commit 9e0e9ea2ae

View File

@ -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.