stores login fix
This commit is contained in:
@@ -24,7 +24,7 @@ type TenantService interface {
|
||||
CreateTenantLocation(data models.Tenantlocations) map[string]interface{}
|
||||
UpdateTenantLocation(data models.Tenantlocations) map[string]interface{}
|
||||
CreateTenantUser(data models.Tenants) (models.UserInfo, error)
|
||||
GetTenantByID(tid int, locationid int) (models.Tenantinfo, error)
|
||||
GetTenantByID(tid int, locationid int, userid int) (models.Tenantinfo, error)
|
||||
GetTenantByKeyword(keyword string) ([]models.TenantSearch, error)
|
||||
}
|
||||
|
||||
@@ -158,8 +158,8 @@ func (s *tenantService) CreateTenantUser(data models.Tenants) (models.UserInfo,
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (s *tenantService) GetTenantByID(tid int, locationid int) (models.Tenantinfo, error) {
|
||||
return s.repo.GetTenantByID(tid, locationid)
|
||||
func (s *tenantService) GetTenantByID(tid int, locationid int, userid int) (models.Tenantinfo, error) {
|
||||
return s.repo.GetTenantByID(tid, locationid, userid)
|
||||
}
|
||||
|
||||
func (s *tenantService) GetTenantByKeyword(keyword string) ([]models.TenantSearch, error) {
|
||||
|
||||
@@ -88,7 +88,7 @@ func (s *userService) AppLogin(user models.User) (models.TenantUserInfo, fiber.M
|
||||
}
|
||||
|
||||
// Inactive account
|
||||
if status == "InActive" {
|
||||
if strings.EqualFold(status, "InActive") {
|
||||
resp := fiber.Map{
|
||||
"status": false,
|
||||
"code": 403,
|
||||
@@ -147,7 +147,7 @@ func (s *userService) AppLogin(user models.User) (models.TenantUserInfo, fiber.M
|
||||
// ✅ Check if assigned store is inactive
|
||||
if info.Locationid > 0 {
|
||||
storeStatus := s.repo.GetLocationStatus(info.Locationid)
|
||||
if storeStatus == "InActive" {
|
||||
if strings.EqualFold(storeStatus, "InActive") {
|
||||
resp := fiber.Map{
|
||||
"status": false,
|
||||
"code": 403,
|
||||
@@ -213,7 +213,7 @@ func (s *userService) TenantWebLogin(user models.User) (models.TenantUserInfo, m
|
||||
}
|
||||
}
|
||||
|
||||
if status == "InActive" {
|
||||
if strings.EqualFold(status, "InActive") {
|
||||
return models.TenantUserInfo{}, map[string]interface{}{
|
||||
"status": false,
|
||||
"code": 403,
|
||||
@@ -272,7 +272,7 @@ func (s *userService) TenantWebLogin(user models.User) (models.TenantUserInfo, m
|
||||
// Step 6: Check if assigned store is inactive
|
||||
if info.Locationid > 0 {
|
||||
storeStatus := s.repo.GetLocationStatus(info.Locationid)
|
||||
if storeStatus == "InActive" {
|
||||
if strings.EqualFold(storeStatus, "InActive") {
|
||||
return models.TenantUserInfo{}, map[string]interface{}{
|
||||
"status": false,
|
||||
"code": 403,
|
||||
|
||||
Reference in New Issue
Block a user