package auth

import (
	"context"
	"server/internal/model"
	"server/internal/service"

	"server/api/auth/v1"
)

func (c *ControllerV1) UserEditPass(ctx context.Context, req *v1.UserEditPassReq) (res *v1.UserEditPassRes, err error) {
	out, err := service.User().EditPass(ctx, &model.UserEditPassIn{Email: req.Email, Password: req.Password, Password2: req.Password2, Sign: req.Sign})
	if err != nil {
		return nil, err
	}
	return &v1.UserEditPassRes{Success: out.Success}, nil
}
