fix: return error when there is no subscribe plan found

This commit is contained in:
ericprd
2025-03-02 10:07:42 +08:00
parent 55460653e3
commit c02d8cda69
3 changed files with 28 additions and 1 deletions
+6 -1
View File
@@ -25,9 +25,14 @@ func (a *AuthSvc) RegisterUser(spec authdomain.RegisterUserReq) (string, error)
spec.SubscribePlanID = subsPlan.ID
}
_, err = a.subsPlanRepo.GetByID(spec.SubscribePlanID)
if err != nil {
return "", errors.New(err.Error())
}
subsId, err := a.subsRepo.Create(spec.SubscribePlanID)
if err != nil {
return "", nil
return "", err
}
hashedPwd, err := HashPassword(spec.Password)