forked from shibao/cannery
use changeset helper
This commit is contained in:
@ -191,22 +191,6 @@ defmodule Cannery.Ammo do
|
||||
def delete_ammo_type!(%AmmoType{user_id: user_id} = ammo_type, %User{id: user_id}),
|
||||
do: ammo_type |> Repo.delete!()
|
||||
|
||||
@doc """
|
||||
Returns an `%Changeset{}` for tracking ammo_type changes.
|
||||
|
||||
## Examples
|
||||
|
||||
iex> change_ammo_type(ammo_type)
|
||||
%Changeset{data: %AmmoType{}}
|
||||
|
||||
"""
|
||||
@spec change_ammo_type(AmmoType.t() | AmmoType.new_ammo_type()) ::
|
||||
Changeset.t(AmmoType.t() | AmmoType.new_ammo_type())
|
||||
@spec change_ammo_type(AmmoType.t() | AmmoType.new_ammo_type(), attrs :: map()) ::
|
||||
Changeset.t(AmmoType.t() | AmmoType.new_ammo_type())
|
||||
def change_ammo_type(%AmmoType{} = ammo_type, attrs \\ %{}),
|
||||
do: AmmoType.update_changeset(ammo_type, attrs)
|
||||
|
||||
@doc """
|
||||
Returns the list of ammo_groups for a user and type.
|
||||
|
||||
|
Reference in New Issue
Block a user