package auth

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

	"server/api/auth/v1"
)

func (c *ControllerV1) UserCode(ctx context.Context, req *v1.UserCodeReq) (res *v1.UserCodeRes, err error) {
	out, err := service.User().Code(ctx, &model.UserCodeIn{Email: req.Email})
	if err != nil {
		return nil, err
	}
	return &v1.UserCodeRes{Success: out.Success}, nil
}
