Improve photo search: include path, student name, and group name in search query
This commit is contained in:
@@ -11446,7 +11446,7 @@ app.get('/api/photos', requireAuth, async (req, res) => {
|
||||
try {
|
||||
const conditions = [];
|
||||
const params = [];
|
||||
if (search) { params.push(`%${search}%`); conditions.push(`t.title ILIKE $${params.length}`); }
|
||||
if (search) { params.push(`%${search}%`); conditions.push(`(t.title ILIKE $${params.length} OR t.path ILIKE $${params.length} OR COALESCE(t.student_name, '') ILIKE $${params.length} OR COALESCE(t.group_name, '') ILIKE $${params.length})`); }
|
||||
if (student_name) { params.push(student_name); conditions.push(`t.student_name = $${params.length}`); }
|
||||
if (group_id) { params.push(group_id); conditions.push(`t.group_id = $${params.length}`); }
|
||||
if (student_id) {
|
||||
|
||||
Reference in New Issue
Block a user