From 67f1ca3ee9a0dc89f0afc2375b8ad911174ce12f Mon Sep 17 00:00:00 2001 From: erikao1998 Date: Thu, 27 Jun 2024 17:59:52 +0300 Subject: [PATCH] Fix university risk calculation --- src/server/util/algorithm/individualRisks.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/server/util/algorithm/individualRisks.ts b/src/server/util/algorithm/individualRisks.ts index eacef1c..b0edb7d 100644 --- a/src/server/util/algorithm/individualRisks.ts +++ b/src/server/util/algorithm/individualRisks.ts @@ -57,17 +57,16 @@ export const totalCountryRisk = ( } export const universityRisk = ( - university: string, + university: string | undefined, countryUniversities: string[] | undefined ) => { - if (!countryUniversities) return null + if (!university) return null - if (countryUniversities.includes(university)) { + if (countryUniversities && countryUniversities.includes(university)) { return 1 } - return 3 - return null + return 3 } export const dualUseRisk = (