1
0

Move the crudhandler to own repo (#27)

This commit is contained in:
konrad
2018-11-30 23:26:56 +00:00
committed by Gitea
parent d9304f6996
commit ce2cae9430
228 changed files with 13281 additions and 3292 deletions

View File

@ -18,7 +18,7 @@ package v1
import (
"code.vikunja.io/api/pkg/models"
"code.vikunja.io/api/pkg/routes/crud"
"code.vikunja.io/web/handler"
"github.com/labstack/echo"
"net/http"
)
@ -43,7 +43,7 @@ func UserResetPassword(c echo.Context) error {
err := models.UserPasswordReset(&pwReset)
if err != nil {
return crud.HandleHTTPError(err)
return handler.HandleHTTPError(err, c)
}
return c.JSON(http.StatusOK, models.Message{"The password was updated successfully."})
@ -69,7 +69,7 @@ func UserRequestResetPasswordToken(c echo.Context) error {
err := models.RequestUserPasswordResetToken(&pwTokenReset)
if err != nil {
return crud.HandleHTTPError(err)
return handler.HandleHTTPError(err, c)
}
return c.JSON(http.StatusOK, models.Message{"Token was sent."})