import { useMutation, useQuery } from "@tanstack/react-query";
import * as api from "../service/Service";

export const useGetFood = (id: string) => {
  return useQuery({
    queryKey: ["food", id],
    queryFn: () => api.getFood(id),
  });
};

export const useToggleFavorite = () => {
  return useMutation({
    mutationFn: api.toggleFavorite,
  });
};
