import axios from "axios";

export async function getAPIDummy(url: any) {
  const response = await axios.get(url).catch((error) => error.response);
  if (response?.status > 300) {
    return {
      error: true,
      message: response?.data?.error_description,
      data: null,
    };
  }
  return {
    error: false,
    message: "success",
    data: response?.data,
  };
}
