forked from shibao/cannery
fix ammo group create not handling invalid attrs
This commit is contained in:
parent
2a0f5720ee
commit
9e0e9ea2ae
@ -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.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user