import axios from "../../../config/axios";
import { CreateResellerType, PaymentType } from "../types/Types";

export const getResellers = async () => {
  const { data } = await axios.get(`/reseller`);
  return data;
};

export const createReseller = async (params: CreateResellerType) => {
  const { data } = await axios.post(`/reseller`, params);
  return data;
};

export const getWithDraws = async (page: number) => {
  const { data } = await axios.get(
    `/reseller/withdraw-request/admin?page=${page}`,
  );
  return data;
};

export const payment = async (params: PaymentType) => {
  const { data } = await axios.patch(
    `/reseller/withdraw-request/${params.id}`,
    params,
  );
  return data;
};
