feat: optimize tenant admin view and enhance user list with dynamic columns and metadata search
This commit is contained in:
1 parent
02acdf835f
commit
d1c3bba3e0
8 files changed
+206
-67
No files matched your search
@@ -176,7 +176,9 @@ func (r *userRepository) List(ctx context.Context, offset, limit int, search str
|
||||
|
||||
if search != "" {
|
||||
searchTerm := "%" + search + "%"
|
||||
db = db.Where("(email LIKE ? OR name LIKE ? OR company_code LIKE ?)", searchTerm, searchTerm, searchTerm)
|
||||
// Search in basic fields and metadata (PostgreSQL JSONB)
|
||||
db = db.Where("(email LIKE ? OR name LIKE ? OR company_code LIKE ? OR metadata::text LIKE ?)",
|
||||
searchTerm, searchTerm, searchTerm, searchTerm)
|
||||
}
|
||||
|
||||
if err := db.Count(&total).Error; err != nil {
|
||||
|
||||
Reference in new issue
Block a user