()
| 41 | // TODO: Remove this useEffect, use new hooks |
| 42 | useEffect(() => { |
| 43 | const fetchUsers = async () => { |
| 44 | setIsLoading(true); |
| 45 | const users = await getUsers({ |
| 46 | page: page < 1 ? DEFAULT_PAGE : page, |
| 47 | totalItems: totalItems < 1 ? DEFAULT_TOTAL_ITEMS : totalItems, |
| 48 | search, |
| 49 | }); |
| 50 | setUsers(users); |
| 51 | setIsLoading(false); |
| 52 | }; |
| 53 | |
| 54 | fetchUsers(); |
| 55 | }, [search, page, totalItems]); |