Fixing /all calls quantity

This commit is contained in:
Lucas Oliveira 2023-11-22 16:58:28 -03:00
commit 470a8e3373
2 changed files with 2 additions and 3 deletions

View file

@ -42,7 +42,7 @@ export function TypesProvider({ children }: { children: ReactNode }) {
const [data, setData] = useState({});
const [fetchError, setFetchError] = useState(false);
const { setLoading } = useContext(alertContext);
const { getAuthentication, autoLogin, userData } = useContext(AuthContext);
const { getAuthentication } = useContext(AuthContext);
const [getFilterEdge, setFilterEdge] = useState([]);
useEffect(() => {
@ -50,7 +50,7 @@ export function TypesProvider({ children }: { children: ReactNode }) {
if (getAuthentication() === true) {
getTypes();
}
}, [getAuthentication(), autoLogin, userData]);
}, [getAuthentication()]);
async function getTypes(): Promise<void> {
// We will keep a flag to handle the case where the component is unmounted before the API call resolves.

View file

@ -51,7 +51,6 @@ export default function ComponentsComponent({
const start = (pageIndex - 1) * pageSize;
const end = start + pageSize;
setData(allData.slice(start, end));
console.log(allData);
}, [pageIndex, pageSize, allData]);
const [data, setData] = useState<FlowType[]>([]);