Fix ListUsers 500 query error (use tenant_id instead of company_id)
This commit is contained in:
parent
722e72cdbd
commit
7a1d0417bc
1 changed files with 2 additions and 2 deletions
|
|
@ -96,7 +96,7 @@ func (s *AdminService) ListUsers(ctx context.Context, page, limit int, companyID
|
|||
countQuery := `SELECT COUNT(*) FROM users`
|
||||
var countArgs []interface{}
|
||||
if companyID != nil && *companyID != "" {
|
||||
countQuery += ` WHERE company_id = $1`
|
||||
countQuery += ` WHERE tenant_id = $1`
|
||||
countArgs = append(countArgs, *companyID)
|
||||
}
|
||||
var total int
|
||||
|
|
@ -111,7 +111,7 @@ func (s *AdminService) ListUsers(ctx context.Context, page, limit int, companyID
|
|||
`
|
||||
var args []interface{}
|
||||
if companyID != nil && *companyID != "" {
|
||||
query += ` WHERE company_id = $1`
|
||||
query += ` WHERE tenant_id = $1`
|
||||
args = append(args, *companyID)
|
||||
}
|
||||
query += ` ORDER BY created_at DESC`
|
||||
|
|
|
|||
Loading…
Reference in a new issue