From 361d5da6a41e4d0717029d3d1422ed99ce087751 Mon Sep 17 00:00:00 2001 From: Valtteri Kantanen Date: Wed, 6 Nov 2024 15:57:37 +0200 Subject: [PATCH] [Class statistics] Fix syntax error in SQL query caused by casing inconsistencies --- services/backend/src/services/populations/shared.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/backend/src/services/populations/shared.ts b/services/backend/src/services/populations/shared.ts index 1afe5876ed..dc32d0d129 100644 --- a/services/backend/src/services/populations/shared.ts +++ b/services/backend/src/services/populations/shared.ts @@ -459,7 +459,11 @@ export const formatStudentsForApi = async ( const getSubstitutions = async (codes: string[]) => { const courses = await Course.findAll({ attributes: ['code', 'substitutions'], - where: { code: codes }, + where: { + code: { + [Op.iLike]: { [Op.any]: codes }, + }, + }, raw: true, })