import {useGetRolesQuery} from "../../../../../Api/rolesApi.js";
import {useRegisterMutation} from "../../../../../Api/registerApi.js";


const useCreateUserModalForm = () => {
    const {
        data: roles = [],
        isLoading: isLoadingRoles,
        isError: isErrorRoles,
    } = useGetRolesQuery(undefined, {
        pollingInterval: 60000,
    });

    const [registerUser] = useRegisterMutation();

    return {
        roles,
        isLoadingRoles,
        isErrorRoles,
        registerUser,
    };
};

export default useCreateUserModalForm;