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

export const useGetUserSubscriptions = (
  page: number,
  status?: string,
  serviceId?: string,
  q?: string,
) => {
  return useQuery({
    queryKey: ["user-subscriptions", page, status, serviceId, q],
    queryFn: () => api.getUserSubscriptions(page, status, serviceId, q),
  });
};

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