ch13.2
This commit is contained in:
@@ -111,7 +111,7 @@ func (app *application) snippetCreatePost(w http.ResponseWriter, r *http.Request
|
||||
form.CheckField(validator.NotBlank(form.Title), "title", "This field cannot be blank")
|
||||
form.CheckField(validator.MaxChars(form.Title, 100), "title", "This field cannot be more than 100 character long")
|
||||
form.CheckField(validator.NotBlank(form.Content), "content", "This field cannot be blank")
|
||||
form.CheckField(validator.PermittedInt(form.Expires, 1, 7, 365), "expires", "This field must equal 1, 7 and 365")
|
||||
form.CheckField(validator.PermittedValue(form.Expires, 1, 7, 365), "expires", "This field must equal 1, 7 and 365")
|
||||
|
||||
if !form.Valid() {
|
||||
data := app.newTemplateData(r)
|
||||
|
||||
Reference in New Issue
Block a user