Use entity update method rather than query. Fixed password reset form action.

This commit is contained in:
mikestefanello 2022-01-09 21:30:09 -05:00
parent acd38c8205
commit d412e06dad
4 changed files with 7 additions and 8 deletions

View file

@ -4,7 +4,6 @@ import (
"github.com/mikestefanello/pagoda/context"
"github.com/mikestefanello/pagoda/controller"
"github.com/mikestefanello/pagoda/ent"
"github.com/mikestefanello/pagoda/ent/user"
"github.com/mikestefanello/pagoda/msg"
"github.com/labstack/echo/v4"
@ -63,10 +62,9 @@ func (c *ResetPassword) Post(ctx echo.Context) error {
usr := ctx.Get(context.UserKey).(*ent.User)
// Update the user
_, err = c.Container.ORM.User.
_, err = usr.
Update().
SetPassword(hash).
Where(user.ID(usr.ID)).
Save(ctx.Request().Context())
if err != nil {