Skip to content

Commit

Permalink
Remove bad validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaptoss committed Jul 11, 2024
1 parent f3ef472 commit 1bb634d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 0 additions & 2 deletions docs/spec/components/schemas/Form.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ allOf:
type: string
id_num:
type: string
pattern: '[0-9]+'
birthday:
type: string
description: DD-MM-YYYY format
Expand All @@ -53,7 +52,6 @@ allOf:
type: string
postal:
type: string
pattern: '[0-9]{5}'
phone:
type: string
email:
Expand Down
2 changes: 0 additions & 2 deletions docs/spec/components/schemas/SubmitForm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ allOf:
type: string
birthday:
type: string
description: DD-MM-YYYY format
citizen:
type: string
visited:
Expand All @@ -46,7 +45,6 @@ allOf:
type: string
postal:
type: string
pattern: '[0-9]{5}'
phone:
type: string
email:
Expand Down
6 changes: 3 additions & 3 deletions internal/service/requests/submit_form.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ func NewSubmitForm(r *http.Request) (req resources.SubmitFormRequest, err error)
"data/type": validation.Validate(req.Data.Type, validation.Required, validation.In(resources.SUBMIT_FORM)),
"data/attributes/name": validation.Validate(req.Data.Attributes.Name, validation.Required),
"data/attributes/surname": validation.Validate(req.Data.Attributes.Surname, validation.Required),
"data/attributes/id_num": validation.Validate(req.Data.Attributes.IdNum, validation.Required, is.Digit),
"data/attributes/birthday": validation.Validate(req.Data.Attributes.Birthday, validation.Required, validation.Date("01-02-2006")),
"data/attributes/id_num": validation.Validate(req.Data.Attributes.IdNum, validation.Required),
"data/attributes/birthday": validation.Validate(req.Data.Attributes.Birthday, validation.Required),
"data/attributes/citizen": validation.Validate(req.Data.Attributes.Citizen, validation.Required),
"data/attributes/visited": validation.Validate(req.Data.Attributes.Visited, validation.Required),
"data/attributes/purpose": validation.Validate(req.Data.Attributes.Purpose, validation.Required),
"data/attributes/country": validation.Validate(req.Data.Attributes.Country, validation.Required),
"data/attributes/city": validation.Validate(req.Data.Attributes.City, validation.Required),
"data/attributes/address": validation.Validate(req.Data.Attributes.Address, validation.Required),
"data/attributes/postal": validation.Validate(req.Data.Attributes.Postal, validation.Required, is.Digit, validation.Length(5, 5)),
"data/attributes/postal": validation.Validate(req.Data.Attributes.Postal, validation.Required),
"data/attributes/phone": validation.Validate(req.Data.Attributes.Phone, validation.Required),
"data/attributes/email": validation.Validate(req.Data.Attributes.Email, validation.Required, is.Email),
"data/attributes/image": validation.Validate(req.Data.Attributes.Image, validation.Required, is.Base64, validation.Length(0, maxImageSize)),
Expand Down

0 comments on commit 1bb634d

Please sign in to comment.