Added check for list title when creating a new list
This commit is contained in:
parent
a9094506fa
commit
935aef8a38
4 changed files with 48 additions and 0 deletions
|
|
@ -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.")
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue