
import axios from "axios";
import { baseUrl } from "../../constants/urls";
export const getToken = async (params:any) => {
  try {
    const url = `${baseUrl}/api/customer-otp-login?token=true`;
const config = {
    method: 'POST',
    url: url,
    data:{
        mobile:params.mobile,
        otp:params.otp
    }
  };

  const token = await axios(config);
 
    console.log(token.data,"login_res.data");
    
     return token.data;
  } catch (error:any) {
    console.log(error.response); // this is the main part. Use the response property from the error object

    return error.response;
  }

}