Validate 'from' and 'to' tokens in client /messages endpoint
This commit is contained in:
parent
659fa17053
commit
224201ae2f
3 changed files with 8 additions and 11 deletions
lib/architex_web/client/request
|
@ -17,5 +17,7 @@ defmodule ArchitexWeb.Client.Request.Messages do
|
|||
|> Architex.validate_not_nil([:from])
|
||||
|> validate_inclusion(:dir, ["b", "f"])
|
||||
|> validate_number(:limit, greater_than: 0)
|
||||
|> validate_format(:from, ~r/^[0-9]*$/)
|
||||
|> validate_format(:to, ~r/^[0-9]+$/)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue