Added check for list title when creating a new list

This commit is contained in:
kolaente 2018-07-26 10:29:09 +02:00
parent a9094506fa
commit 935aef8a38
Signed by untrusted user who does not match committer: konrad
GPG key ID: F40E70337AB24C9B
4 changed files with 48 additions and 0 deletions

View file

@ -35,6 +35,9 @@ func (c *WebHandler) CreateWeb(ctx echo.Context) error {
if models.IsErrListDoesNotExist(err) {
return echo.NewHTTPError(http.StatusBadRequest, "The list does not exist.")
}
if models.IsErrListTitleCannotBeEmpty(err) {
return echo.NewHTTPError(http.StatusBadRequest, "You must provide at least a list title.")
}
if models.IsErrListItemCannotBeEmpty(err) {
return echo.NewHTTPError(http.StatusBadRequest, "You must provide at least a list item text.")
}