Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2960 | Rev 3432 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |

import { axios } from '@app/utils'

export const getOnRoom = async () => {
  const { data: response } = await axios.post('/moodle')
  const { data, success } = response

  const url = new URL(data.url)

  Object.keys(response).forEach((key) => {
    if (key === 'url') return
    url.searchParams.set(key, response[key])
  })

  if (!success) {
    throw new Error('Ha ocurrido un error en la comunicacion con ON ROOM')
  }

  return url
}