forked from shibao/cannery
Fix not being able to edit ammo group when fully used up
This commit is contained in:
parent
d27b54386d
commit
3297130890
@ -1,5 +1,6 @@
|
||||
# v0.5.0
|
||||
- Add German translation: Thank you [Kaia](https://shitposter.club/users/kaia)!
|
||||
- Fix not being able to edit ammo group when fully used up
|
||||
|
||||
# v0.4.1
|
||||
- Fix button and tag text wrapping
|
||||
|
@ -62,7 +62,7 @@ defmodule Cannery.Ammo.AmmoGroup do
|
||||
def update_changeset(ammo_group, attrs) do
|
||||
ammo_group
|
||||
|> cast(attrs, [:count, :price_paid, :notes, :staged, :ammo_type_id, :container_id])
|
||||
|> validate_number(:count, greater_than: 0)
|
||||
|> validate_number(:count, greater_than_or_equal_to: 0)
|
||||
|> validate_required([:count, :staged, :ammo_type_id, :container_id, :user_id])
|
||||
end
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
<%= label(f, :count, gettext("Count"), class: "title text-lg text-primary-600") %>
|
||||
<%= number_input(f, :count,
|
||||
class: "text-center col-span-2 input input-primary",
|
||||
min: 1
|
||||
min: 0
|
||||
) %>
|
||||
<%= error_tag(f, :count, "col-span-3 text-center") %>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user