added additional tests for parent id
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"GoMembership/internal/models"
|
||||
"GoMembership/internal/services"
|
||||
|
||||
@@ -45,7 +47,7 @@ func (uc *UserController) RegisterUser(c *gin.Context) {
|
||||
id, token, err := uc.Service.RegisterUser(®Data.User)
|
||||
if err != nil {
|
||||
logger.Error.Printf("Couldn't register User: %v", err)
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "Couldn't register User"})
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("Couldn't register User: %v", err)})
|
||||
return
|
||||
}
|
||||
regData.User.ID = id
|
||||
@@ -85,7 +87,6 @@ func (uc *UserController) RegisterUser(c *gin.Context) {
|
||||
logger.Error.Printf("Failed to notify admin of new user registration: %v", err)
|
||||
// Proceed without returning error since user registration is successful
|
||||
}
|
||||
|
||||
c.JSON(http.StatusCreated, gin.H{
|
||||
"status": "success",
|
||||
"id": regData.User.ID,
|
||||
|
||||
Reference in New Issue
Block a user