import { queryOptions } from "@tanstack/react-query";
import axios from "axios";

export function getInvoices() {
	return queryOptions({
		queryKey: ["getInvoices"],
		queryFn: () => fetch(),
		staleTime: 5000,
		refetchOnWindowFocus: true,
	});
}

const fetch = async () => {
	const { data } = await axios.get("/lst/api/forklifts/invoices");

	return data.data;
};
