remove unchangeable requirements

This commit is contained in:
2022-07-01 19:53:44 -04:00
parent 5fd46c326f
commit 67010640f0
5 changed files with 6 additions and 6 deletions

View File

@@ -63,7 +63,7 @@ defmodule Cannery.Ammo.AmmoGroup do
ammo_group
|> cast(attrs, [:count, :price_paid, :notes, :staged, :ammo_type_id, :container_id])
|> validate_number(:count, greater_than_or_equal_to: 0)
|> validate_required([:count, :staged, :ammo_type_id, :container_id, :user_id])
|> validate_required([:count, :staged, :ammo_type_id, :container_id])
end
@doc """
@@ -75,6 +75,6 @@ defmodule Cannery.Ammo.AmmoGroup do
def range_changeset(ammo_group, attrs) do
ammo_group
|> cast(attrs, [:count, :staged])
|> validate_required([:count, :staged, :ammo_type_id, :container_id, :user_id])
|> validate_required([:count, :staged])
end
end

View File

@@ -118,6 +118,6 @@ defmodule Cannery.Ammo.AmmoType do
def update_changeset(ammo_type, attrs) do
ammo_type
|> cast(attrs, changeset_fields())
|> validate_required([:name, :user_id])
|> validate_required(:name)
end
end