diff --git a/website/components/FunctionsList/FunctionsList.js b/website/components/FunctionsList/FunctionsList.js index cd24467..356d014 100644 --- a/website/components/FunctionsList/FunctionsList.js +++ b/website/components/FunctionsList/FunctionsList.js @@ -53,18 +53,16 @@ const FunctionsList = (props) => { if (node) observer.current.observe(node); }, [isLoadingFunctions, functionsData.hasMore]); - const getFunctionsData = () => { + const getFunctionsData = async () => { setLoadingFunctions(true); - return new Promise(async (next) => { - const URL = `${(props.isAdmin) ? "/admin/functions" : "/functions"}?page=${pageFunctions}&limit=10&categoryId=${inputSearch.selectedCategory}&search=${inputSearch.search}`; - const result = await api.get(URL, { - headers: { - ...(props.isAdmin && props.token != undefined) && { 'Authorization': props.token } - } - }); - setLoadingFunctions(false); - next(result.data); + const URL = `${(props.isAdmin) ? "/admin/functions" : "/functions"}?page=${pageFunctions}&limit=10&categoryId=${inputSearch.selectedCategory}&search=${inputSearch.search}`; + const result = await api.get(URL, { + headers: { + ...(props.isAdmin && props.token != undefined) && { 'Authorization': props.token } + } }); + setLoadingFunctions(false); + return result.data; } const handleChange = (event) => { @@ -86,7 +84,7 @@ const FunctionsList = (props) => { ))} - +
diff --git a/website/components/Header/Header.js b/website/components/Header/Header.js index 2e977a0..8dc2c3f 100644 --- a/website/components/Header/Header.js +++ b/website/components/Header/Header.js @@ -37,6 +37,7 @@ export default function Header() {