import { useQuery } from "@tanstack/react-query";
import { getUnitInfo, getUnitInfoByUnitID } from "../services/api/userService";

export const useUnitInfo = () => {
  return useQuery({
    queryKey: ["unitInfo"],
    queryFn: async () => {
      const { data } = await getUnitInfo();
      return data ;
    },
  });
};


export const useUnitInfoByUnitID = (unitID:string) => {
  return useQuery({
    queryKey: ["unitInfobyID"],
    queryFn: async () => {
      const { data } = await getUnitInfoByUnitID(unitID);
      return data;
    },
  });
};
