Mhamdans17 commited on
Commit ·
5cd9ed5
1
Parent(s): 36aac72
fix: tenant settings not fetching and caching correctly
Browse files
controllers/auth_controller.go
CHANGED
|
@@ -186,7 +186,7 @@ func Login(c *gin.Context) {
|
|
| 186 |
var user models.User
|
| 187 |
if err := config.DB.Select("id, name, email, password, phone, role, company_id, branch_id, is_active, created_at").
|
| 188 |
Preload("Company", func(db *gorm.DB) *gorm.DB {
|
| 189 |
-
return db.Select("id, name, approved_at, is_active")
|
| 190 |
}).
|
| 191 |
Preload("Branch", func(db *gorm.DB) *gorm.DB {
|
| 192 |
return db.Select("id, name")
|
|
|
|
| 186 |
var user models.User
|
| 187 |
if err := config.DB.Select("id, name, email, password, phone, role, company_id, branch_id, is_active, created_at").
|
| 188 |
Preload("Company", func(db *gorm.DB) *gorm.DB {
|
| 189 |
+
return db.Select("id, name, approved_at, is_active, enable_member, enable_voucher, enable_multi_branch, enable_multi_kasir")
|
| 190 |
}).
|
| 191 |
Preload("Branch", func(db *gorm.DB) *gorm.DB {
|
| 192 |
return db.Select("id, name")
|
controllers/company_controller.go
CHANGED
|
@@ -105,7 +105,7 @@ func ListCompanies(c *gin.Context) {
|
|
| 105 |
searchQuery := c.Query("search")
|
| 106 |
|
| 107 |
query := config.DB.Model(&models.Company{}).
|
| 108 |
-
Select("id, name, bank_account_number, bank_name, address, email, phone, logo_url, is_active, fee_percentage, cash_fee_rules, qris_fee_percentage, qris_fee_fixed, qris_fee_min, qris_min_transaction, allow_qris_below_min, charge_fee_before_discount, wallet_balance, wallet_limit, approved_at, created_at")
|
| 109 |
|
| 110 |
if searchQuery != "" {
|
| 111 |
query = query.Where("name ILIKE ? OR email ILIKE ? OR phone ILIKE ? OR address ILIKE ?",
|
|
|
|
| 105 |
searchQuery := c.Query("search")
|
| 106 |
|
| 107 |
query := config.DB.Model(&models.Company{}).
|
| 108 |
+
Select("id, name, bank_account_number, bank_name, address, email, phone, logo_url, is_active, fee_percentage, cash_fee_rules, qris_fee_percentage, qris_fee_fixed, qris_fee_min, qris_min_transaction, allow_qris_below_min, charge_fee_before_discount, wallet_balance, wallet_limit, enable_member, enable_voucher, enable_multi_branch, enable_multi_kasir, approved_at, created_at")
|
| 109 |
|
| 110 |
if searchQuery != "" {
|
| 111 |
query = query.Where("name ILIKE ? OR email ILIKE ? OR phone ILIKE ? OR address ILIKE ?",
|