import useSWR from "swr";
import { post } from "../http";

function usePost<T = any, E = any>(api: string, data?: unknown) {
  return useSWR<ResData<T>, E>([api, data], post, {
    revalidateOnFocus: false,
  });
}

export default usePost;
