Fix for bad region data.

This commit is contained in:
Mike Cao 2023-08-28 10:26:10 -07:00
parent 684587f945
commit 02efac63c5

View File

@ -138,7 +138,12 @@ async function clickhouseQuery(data: {
session_id: sessionId,
event_id: uuid(),
country: country,
subdivision1: subdivision1,
subdivision1:
country && subdivision1
? subdivision1.includes('-')
? subdivision1
: `${country}-${subdivision1}`
: null,
subdivision2: subdivision2,
city: city,
url_path: urlPath?.substring(0, URL_LENGTH),