import axios from 'src/utils/axios';

// ----------------------------------------------------------------------

export async function getReferralProfile() {
  try {
    const res = await axios.get('/referrals/my_profile/');
    return res.data;
  } catch {
    return null;
  }
}

export async function getReferralStats() {
  try {
    const res = await axios.get('/referrals/stats/');
    return res.data;
  } catch {
    return null;
  }
}

export async function getMyReferrals() {
  const res = await axios.get('/referrals/my_referrals/');
  return res.data;
}

export async function setReferrer(referralCode) {
  await axios.post('/referrals/set_referrer/', { referral_code: referralCode.trim() });
}
