import axios from 'src/utils/axios';

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

export async function generateTelegramCode() {
  const res = await axios.post('/notifications/preferences/telegram/generate-code/');
  return res.data ?? res;
}

export async function unlinkTelegram() {
  const res = await axios.post('/notifications/preferences/telegram/unlink/');
  return res.data ?? res;
}

export async function getTelegramStatus() {
  const res = await axios.get('/notifications/preferences/telegram/status/');
  const {data} = res;
  return data?.data ?? data;
}

export async function getTelegramBotInfo() {
  const res = await axios.get('/notifications/preferences/telegram/bot-info/');
  const {data} = res;
  return data?.data ?? data;
}
