main
Nilo Roberto C Paim 2024-05-29 17:00:50 -03:00
parent ea4aa84a97
commit 8bbedaffde
1 changed files with 5 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import (
"api/database"
"api/models"
"api/utils"
"fmt"
"log"
"strconv"
"strings"
@ -194,6 +195,8 @@ func Checkuser(c *fiber.Ctx) error {
// Check if user exists
database.DB.Where("email = ?", email).First(&user)
fmt.Printf("User Channel: [%s]\n", user.Channel)
if user.ID == 0 {
// The user is not found; let's check if it's a test user
database.DB.Where("email = ?", email).First(&usertest)
@ -211,10 +214,10 @@ func Checkuser(c *fiber.Ctx) error {
}
}
} else {
// The user is found and it's a payable user; let's signalize this
// The user is found and it's a pay user; let's signalize this
if user.UserType == "U" {
response.Type = "U"
// If the user doesn't have a channel, it's a social user that needs to complete the registration
// If the user doesn't have a channel, it's a pay user that needs to complete the registration
if user.Channel == "" {
response.Type = "RU"
}