import axios from 'src/utils/axios';

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

/**
 * POST /video/livekit/create-room/
 */
export async function createLiveKitRoom(lessonId) {
  const res = await axios.post('/video/livekit/create-room/', { lesson_id: lessonId });
  return res.data;
}

/**
 * GET /video/livekit/config/
 */
export async function getLiveKitConfig() {
  const res = await axios.get('/video/livekit/config/');
  return res.data;
}

/**
 * POST /video/livekit/participant-connected/
 */
export async function participantConnected({ roomName, lessonId }) {
  const body = { room_name: roomName };
  if (lessonId != null) body.lesson_id = lessonId;
  await axios.post('/video/livekit/participant-connected/', body);
}
