diff --git a/app/javascript/components/shared/queryClient.js b/app/javascript/components/shared/queryClient.js index 9ec274d87..9a5471252 100644 --- a/app/javascript/components/shared/queryClient.js +++ b/app/javascript/components/shared/queryClient.js @@ -1,5 +1,5 @@ import { QueryClient } from 'react-query'; -import { isNumeric } from '@utils'; +import { getJSON, isNumeric } from '@utils'; import { matchSorter } from 'match-sorter'; const API_EDUCATION_QUERY_LIMIT = 5; @@ -73,7 +73,7 @@ async function defaultQueryFn({ queryKey: [scope, term] }) { let paysCache; async function getPays() { if (!paysCache) { - paysCache = await fetch('/api/pays').then((response) => response.json()); + paysCache = await getJSON('/api/pays', null); } return paysCache; }