fix(SW-2921): Fixed issue with countryName missing from locations response
* fix(SW-2921): Added more correct cache key to locations endpoint Approved-by: Joakim Jäderberg Approved-by: Linus Flood
This commit is contained in:
@@ -253,8 +253,15 @@ export async function getLocations({
|
||||
serviceToken: string
|
||||
}) {
|
||||
const cacheClient = await getCacheClient()
|
||||
const countryKeys = Object.keys(citiesByCountry ?? {})
|
||||
let cacheKey = `${lang}:locations`
|
||||
|
||||
if (countryKeys.length) {
|
||||
cacheKey += `:${countryKeys.join(",")}`
|
||||
}
|
||||
|
||||
return await cacheClient.cacheOrGet(
|
||||
`${lang}:locations`.toLowerCase(),
|
||||
cacheKey.toLowerCase(),
|
||||
async () => {
|
||||
const params = new URLSearchParams({
|
||||
language: toApiLang(lang),
|
||||
|
||||
Reference in New Issue
Block a user