Normalize fetch response.

This commit is contained in:
Mike Cao 2025-02-05 22:02:51 -08:00
parent dcf0da7b14
commit 444b828bc9
5 changed files with 38 additions and 25 deletions

View file

@ -10,7 +10,7 @@ export function useCountryNames(locale: string) {
const [list, setList] = useState(countryNames[locale] || enUS);
async function loadData(locale: string) {
const { data } = await httpGet(`${process.env.basePath || ''}/intl/country/${locale}.json`);
const data = await httpGet(`${process.env.basePath || ''}/intl/country/${locale}.json`);
if (data) {
countryNames[locale] = data;