diff options
author | Marco <marcoambrosini@icloud.com> | 2023-01-31 10:34:11 +0100 |
---|---|---|
committer | Marco <marcoambrosini@icloud.com> | 2023-01-31 20:42:42 +0100 |
commit | 9c6935e9fdc26115369af036912f35fb8931828b (patch) | |
tree | 3ffbdffc487e9fe66ae61a66dc2699ba869faf00 | |
parent | da10b18d848ac8c6a2051b67152522b1067e1663 (diff) |
Add some documentation to the api calls
Signed-off-by: Marco <marcoambrosini@icloud.com>
-rw-r--r-- | src/services/breakoutRoomsService.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/services/breakoutRoomsService.js b/src/services/breakoutRoomsService.js index 84ca0f567..8c91bbc0b 100644 --- a/src/services/breakoutRoomsService.js +++ b/src/services/breakoutRoomsService.js @@ -22,6 +22,16 @@ import axios from '@nextcloud/axios' import { generateOcsUrl } from '@nextcloud/router' +/** + * Create breakout rooms for a given conversation + * + * @param token The conversation token + * @param mode Either manual, auto, or free, see constants file + * @param amount The amount of breakout rooms to be created + * @param attendeeMap A json encoded Map of attendeeId => room number (0 based) + * (Only considered when the mode is "manual") + * @return {Promise<AxiosResponse<any>>} + */ const configureBreakoutRooms = async function(token, mode, amount, attendeeMap) { return await axios.post(generateOcsUrl('/apps/spreed/api/v1/breakout-rooms/{token}', { token }), { mode, @@ -30,18 +40,41 @@ const configureBreakoutRooms = async function(token, mode, amount, attendeeMap) }) } +/** + * Deletes all breakout rooms for a given conversation + * + * @param token + * @return {Promise<AxiosResponse<any>>} + */ const deleteBreakoutRooms = async function(token) { return await axios.delete(generateOcsUrl('/apps/spreed/api/v1/breakout-rooms/{token}', { token })) } +/** + * Fetches the breakout rooms for given conversation + * + * @param token The conversation token + * @return {Promise<AxiosResponse<any>>} The array of conversations + */ const getBreakoutRooms = async function(token) { return await axios.get(generateOcsUrl('/apps/spreed/api/v4/room/{token}/breakout-rooms', { token })) } +/** + * + * @param token The conversation token + * @return {Promise<AxiosResponse<any>>} The array of conversations + */ const startBreakoutRooms = async function(token) { return await axios.post(generateOcsUrl('/apps/spreed/api/v1/breakout-rooms/{token}/rooms', { token })) } +/** + * Stops the breakout rooms + * + * @param token The conversation token + * @return {Promise<AxiosResponse<any>>} The array of conversations + */ const stopBreakoutRooms = async function(token) { return await axios.delete(generateOcsUrl('/apps/spreed/api/v1/breakout-rooms/{token}/rooms', { token })) } |