25 lines
749 B
JavaScript
Vendored
25 lines
749 B
JavaScript
Vendored
import http from './http';
|
|
import { getConfig } from '../utils/config';
|
|
|
|
function routes() {
|
|
return getConfig().routes?.meetings || {};
|
|
}
|
|
|
|
export function fetchMeetings(status = '') {
|
|
return http.get(routes().index, { params: { status } }).then((r) => r.data);
|
|
}
|
|
|
|
export function createMeeting(payload) {
|
|
return http.post(routes().store, payload).then((r) => r.data);
|
|
}
|
|
|
|
export function endMeeting(id) {
|
|
return http.post(`${routes().base}/${id}/end`).then((r) => r.data);
|
|
}
|
|
|
|
export function fetchMeetingToken(id, payload = {}) {
|
|
const routes = getConfig().routes?.meetings || {};
|
|
const url = routes.token || `${routes.base || '/communication/meetings'}/${id}/token`;
|
|
return http.post(url, payload).then((r) => r.data);
|
|
}
|