package auth

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

	"server/api/auth/v1"
)

func (c *ControllerV1) UserRegister(ctx context.Context, req *v1.UserRegisterReq) (res *v1.UserRegisterRes, err error) {
	out, err := service.User().Register(ctx, &model.UserRegisterIn{Email: req.Email, Password: req.Password, Password2: req.Password2})
	if err != nil {
		return nil, err
	}
	return &v1.UserRegisterRes{Success: out.Success}, nil
}
