import proxy from "../proxy";
import { Dispatch } from "redux";
const userFactor = {
  payment:
    (data1 = {}, data2 = {}) =>
    async (dispatch: Dispatch) => {
      await proxy.post("userProduct/addVOD", data1, { dispatch });
      await proxy.post("userFactor/paymentVOD", data2, { dispatch });
    },
  verify:
    (data = {}) =>
    async (dispatch: Dispatch) =>
      await proxy.post("userFactor/verifyVOD", data, { dispatch }),
  info:
    (data = {}) =>
    async (dispatch: Dispatch) =>
      await proxy.get("userFactor/info", data, { dispatch }),
  update:
    (data = {}, data2 = {}) =>
    async (dispatch: Dispatch) => {
      await proxy.put("userFactor/update", data, { dispatch });
      await proxy.get("userFactor/info", data2, { dispatch });
    },
  deleteUserOffCode:
    (data = {}, data2 = {}) =>
    async (dispatch: Dispatch) => {
      await proxy.delete("userFactor/deleteUserOffCode", data, { dispatch });
      await proxy.get("userFactor/info", data2, { dispatch });
    },
};

export default userFactor;
