Add string length validations to user-input schemas

This commit is contained in:
Claudio Ortolina
2026-03-05 20:42:44 +00:00
parent 70392857fa
commit d738032f8a
4 changed files with 6 additions and 0 deletions
@@ -20,6 +20,8 @@ defmodule MusicLibrary.RecordSets.RecordSet do
record_set
|> cast(attrs, [:name, :description])
|> validate_required([:name])
|> validate_length(:name, min: 1, max: 100)
|> validate_length(:description, max: 10_000)
end
def count_by_status(record_set) do