fix(user): fix column aliases and replace SELECT * with explicit columns
Fix customer_relationship.go: use consistent 'cnt' alias instead of duplicate 'count' column. Fix profile.go: replace SELECT * with explicit column list to avoid new computed booking columns breaking the admin listing query. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -512,7 +512,7 @@ func ListAdminUsersHandler(w http.ResponseWriter, r *http.Request) {
|
||||
if searchTerm != "" {
|
||||
searchPattern := "%" + searchTerm + "%"
|
||||
|
||||
innerWithWhere := `SELECT * FROM (` + innerQuery + `
|
||||
innerWithWhere := `SELECT id, fn, email, phone, account_role, created_at, previous_first_name, previous_last_name, completed_count FROM (` + innerQuery + `
|
||||
WHERE (u.fn ILIKE $1 OR u.email ILIKE $1 OR u.phone ILIKE $1)
|
||||
) sub`
|
||||
|
||||
@@ -532,7 +532,7 @@ func ListAdminUsersHandler(w http.ResponseWriter, r *http.Request) {
|
||||
listQuery += ` ORDER BY completed_count DESC, created_at DESC, id DESC LIMIT $` + strconv.Itoa(len(listArgs)+1)
|
||||
listArgs = append(listArgs, perPage+1)
|
||||
} else {
|
||||
innerNoWhere := `SELECT * FROM (` + innerQuery + `) sub`
|
||||
innerNoWhere := `SELECT id, fn, email, phone, account_role, created_at, previous_first_name, previous_last_name, completed_count FROM (` + innerQuery + `) sub`
|
||||
|
||||
if cursorStr != "" {
|
||||
cursorCount, cursorCreatedAt, cursorID, err := validators.ParseCursor3(cursorStr)
|
||||
|
||||
Reference in New Issue
Block a user