import {axiosApiInstance} from "../api/axiosAPIClient";
import { endPoints } from "../constants/enums";
import { getAPIPrefix } from "./wrapperService";
const REACT_APP_AUTHAPI_URL = process.env.REACT_APP_AUTHAPI_URL;
const REACT_APP_EXPAPI_URL = process.env.REACT_APP_EXPAPI_URL;
const RESET_PASSWORD_URL = endPoints.RESET_PASSWORD_URL;
const SEND_FEEDBACK_URL = endPoints.SEND_FEEDBACK_URL;

export const SendFeedback = async (input, brandID) => {
  try {
    const url = `${REACT_APP_EXPAPI_URL}${SEND_FEEDBACK_URL}${brandID}`;
    const response = await axiosApiInstance.post(url, input);
    if (response.status === 200) {
      return await response.data;
    }
  } catch (err) {
    throw new Error("Exception occurred");
  }
};

export const ResetPassword = async (input) => {
  const url = `${REACT_APP_AUTHAPI_URL}${getAPIPrefix()}${RESET_PASSWORD_URL}`;
  const response = await axiosApiInstance.post(url, input);
  return await response.data;
};
