1
0
forked from baron/baron-sso

feat: optimize tenant admin view and enhance user list with dynamic columns and metadata search

This commit is contained in:
2026-03-04 13:32:01 +09:00
parent 02acdf835f
commit d1c3bba3e0
8 changed files with 206 additions and 67 deletions

View File

@@ -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 {