You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letqueryString='FROM users WHERE approved = TRUE ';
37
+
if(accountType==='admin'){
38
+
queryString+=`AND type = 'admin'`;
39
+
}elseif(accountType==='student'){
40
+
queryString+=`AND type = 'student'`;
41
+
}
42
+
letapprovedAccounts;
43
+
letparams=[];
36
44
if(keyword){
37
-
constuserSearchResult=awaitdb.query(
38
-
`SELECT * FROM users WHERE approved = TRUE AND (first_name ILIKE $1 OR last_name ILIKE $2 OR email ILIKE $3 OR CONCAT(first_name, ' ', last_name) ILIKE $4) ORDER BY first_name ASC LIMIT $5 OFFSET $6;`,
`SELECT * ${queryString} AND (first_name ILIKE $1 OR last_name ILIKE $2 OR email ILIKE $3 OR CONCAT(first_name, ' ', last_name) ILIKE $4) ORDER BY first_name ASC LIMIT $5 OFFSET $6;`,
0 commit comments