Fixed infinite loop on the dashboards
This commit is contained in:
@@ -2,10 +2,13 @@ import {Type, User} from "@/interfaces/user";
|
||||
import Axios from "axios";
|
||||
import {useEffect, useState} from "react";
|
||||
import {setupCache} from "axios-cache-interceptor";
|
||||
|
||||
const instance = Axios.create();
|
||||
const axios = setupCache(instance);
|
||||
|
||||
export const userHashStudent = { type: "student" } as { type: Type };
|
||||
export const userHashTeacher = { type: "teacher" } as { type: Type };
|
||||
export const userHashCorporate = { type: "corporate" } as { type: Type };
|
||||
|
||||
export default function useUsers(props?: {type?: Type; page?: number; size?: number}) {
|
||||
const [users, setUsers] = useState<User[]>([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
|
||||
Reference in New Issue
Block a user