import axios from "axios";
import { Node } from "~/classes/Node";

export function getNodes(onSuccess: (nodes: Node[]) => void)
{
    axios.get<Node[]>(ApiConfig.getHttpBase() + '/nodes', {
        headers: {
            Authorization: "Bearer " + requireToken()
        }
    })
    .then((response) => {
        onSuccess(response.data);
    })
    .catch();
}