feat: Add update user password endpoint (#1310)

This commit is contained in:
Bruno Quaresma
2022-05-06 09:20:08 -05:00
committed by GitHub
parent a2be7c0294
commit 57bb108465
12 changed files with 160 additions and 26 deletions
+19
View File
@@ -2264,6 +2264,25 @@ func (q *sqlQuerier) InsertUser(ctx context.Context, arg InsertUserParams) (User
return i, err
}
const updateUserHashedPassword = `-- name: UpdateUserHashedPassword :exec
UPDATE
users
SET
hashed_password = $2
WHERE
id = $1
`
type UpdateUserHashedPasswordParams struct {
ID uuid.UUID `db:"id" json:"id"`
HashedPassword []byte `db:"hashed_password" json:"hashed_password"`
}
func (q *sqlQuerier) UpdateUserHashedPassword(ctx context.Context, arg UpdateUserHashedPasswordParams) error {
_, err := q.db.ExecContext(ctx, updateUserHashedPassword, arg.ID, arg.HashedPassword)
return err
}
const updateUserProfile = `-- name: UpdateUserProfile :one
UPDATE
users