Fixing /all calls quantity
This commit is contained in:
parent
0d785c923a
commit
470a8e3373
2 changed files with 2 additions and 3 deletions
|
|
@ -42,7 +42,7 @@ export function TypesProvider({ children }: { children: ReactNode }) {
|
||||||
const [data, setData] = useState({});
|
const [data, setData] = useState({});
|
||||||
const [fetchError, setFetchError] = useState(false);
|
const [fetchError, setFetchError] = useState(false);
|
||||||
const { setLoading } = useContext(alertContext);
|
const { setLoading } = useContext(alertContext);
|
||||||
const { getAuthentication, autoLogin, userData } = useContext(AuthContext);
|
const { getAuthentication } = useContext(AuthContext);
|
||||||
const [getFilterEdge, setFilterEdge] = useState([]);
|
const [getFilterEdge, setFilterEdge] = useState([]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -50,7 +50,7 @@ export function TypesProvider({ children }: { children: ReactNode }) {
|
||||||
if (getAuthentication() === true) {
|
if (getAuthentication() === true) {
|
||||||
getTypes();
|
getTypes();
|
||||||
}
|
}
|
||||||
}, [getAuthentication(), autoLogin, userData]);
|
}, [getAuthentication()]);
|
||||||
|
|
||||||
async function getTypes(): Promise<void> {
|
async function getTypes(): Promise<void> {
|
||||||
// We will keep a flag to handle the case where the component is unmounted before the API call resolves.
|
// We will keep a flag to handle the case where the component is unmounted before the API call resolves.
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,6 @@ export default function ComponentsComponent({
|
||||||
const start = (pageIndex - 1) * pageSize;
|
const start = (pageIndex - 1) * pageSize;
|
||||||
const end = start + pageSize;
|
const end = start + pageSize;
|
||||||
setData(allData.slice(start, end));
|
setData(allData.slice(start, end));
|
||||||
console.log(allData);
|
|
||||||
}, [pageIndex, pageSize, allData]);
|
}, [pageIndex, pageSize, allData]);
|
||||||
|
|
||||||
const [data, setData] = useState<FlowType[]>([]);
|
const [data, setData] = useState<FlowType[]>([]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue