refactor: use tryParseRequest

This commit is contained in:
Derrick Hammer 2023-06-07 08:49:07 -04:00
parent f3e43f522f
commit 9d843bffdb
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 3 deletions

View File

@ -64,9 +64,7 @@ func hashPassword(password string) (string, error) {
func (a *AccountController) PostRegister() {
var r RegisterRequest
if err := a.Ctx.ReadJSON(&r); err != nil {
logger.Get().Debug("failed to parse request", zap.Error(err))
a.Ctx.StopWithError(iris.StatusBadRequest, err)
if !tryParseRequest(r, a.Ctx) {
return
}