diff options
author | Joas Schilling <coding@schilljs.com> | 2020-10-28 15:00:36 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-10-30 10:38:52 +0100 |
commit | 6b3f5e04c1e9bb9c2f784264af0ce7fe01273a43 (patch) | |
tree | da97151a6b6389e2d8f23fdf0ab70ab767f2f96a /src/services | |
parent | b0b6cb952487f731ad6ebe82dfeb75fbb37c0303 (diff) |
User v3 APIs to display email invites
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'src/services')
-rw-r--r-- | src/services/conversationsService.js | 4 | ||||
-rw-r--r-- | src/services/participantsService.js | 22 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/services/conversationsService.js b/src/services/conversationsService.js index 534799571..528c02347 100644 --- a/src/services/conversationsService.js +++ b/src/services/conversationsService.js @@ -33,7 +33,7 @@ let maintenanceWarning = null */ const fetchConversations = async function() { try { - const response = await axios.get(generateOcsUrl('apps/spreed/api/v2', 2) + 'room') + const response = await axios.get(generateOcsUrl('apps/spreed/api/v3', 2) + 'room') if (maintenanceWarning) { maintenanceWarning.hideToast() @@ -59,7 +59,7 @@ const fetchConversations = async function() { */ const fetchConversation = async function(token) { try { - const response = await axios.get(generateOcsUrl('apps/spreed/api/v2', 2) + `room/${token}`) + const response = await axios.get(generateOcsUrl('apps/spreed/api/v3', 2) + `room/${token}`) if (maintenanceWarning) { maintenanceWarning.hideToast() diff --git a/src/services/participantsService.js b/src/services/participantsService.js index 26321ee56..06eb3a52c 100644 --- a/src/services/participantsService.js +++ b/src/services/participantsService.js @@ -46,7 +46,7 @@ const joinConversation = async(token) => { const forceJoin = SessionStorage.getItem('joined_conversation') === token try { - const response = await axios.post(generateOcsUrl('apps/spreed/api/v2', 2) + `room/${token}/participants/active`, { + const response = await axios.post(generateOcsUrl('apps/spreed/api/v3', 2) + `room/${token}/participants/active`, { force: forceJoin, }) @@ -131,7 +131,7 @@ const forceJoinConversation = async(token) => { * @param {string} token The conversation token; */ const rejoinConversation = async(token) => { - return axios.post(generateOcsUrl('apps/spreed/api/v2', 2) + `room/${token}/participants/active`) + return axios.post(generateOcsUrl('apps/spreed/api/v3', 2) + `room/${token}/participants/active`) } /** @@ -144,7 +144,7 @@ const leaveConversation = async function(token) { // FIXME Signaling should not be synchronous await signalingLeaveConversation(token) - const response = await axios.delete(generateOcsUrl('apps/spreed/api/v2', 2) + `room/${token}/participants/active`) + const response = await axios.delete(generateOcsUrl('apps/spreed/api/v3', 2) + `room/${token}/participants/active`) return response } catch (error) { console.debug(error) @@ -157,7 +157,7 @@ const leaveConversation = async function(token) { * @param {string} token The conversation token; */ const leaveConversationSync = function(token) { - axios.delete(generateOcsUrl('apps/spreed/api/v2/room', 2) + token + '/participants/active') + axios.delete(generateOcsUrl('apps/spreed/api/v3/room', 2) + token + '/participants/active') } /** @@ -167,7 +167,7 @@ const leaveConversationSync = function(token) { * @param {string} source the source Source of the participant as returned by the autocomplete suggestion endpoint (default is users) */ const addParticipant = async function(token, newParticipant, source) { - const response = await axios.post(generateOcsUrl('apps/spreed/api/v2', 2) + `room/${token}/participants`, { + const response = await axios.post(generateOcsUrl('apps/spreed/api/v3', 2) + `room/${token}/participants`, { newParticipant, source, }) @@ -180,13 +180,13 @@ const addParticipant = async function(token, newParticipant, source) { * @param {string} token The conversation token; */ const removeCurrentUserFromConversation = async function(token) { - const response = await axios.delete(generateOcsUrl('apps/spreed/api/v2', 2) + `room/${token}/participants/self`) + const response = await axios.delete(generateOcsUrl('apps/spreed/api/v3', 2) + `room/${token}/participants/self`) return response } const removeUserFromConversation = async function(token, userId) { try { - const response = await axios.delete(generateOcsUrl('apps/spreed/api/v2', 2) + `room/${token}/participants`, { + const response = await axios.delete(generateOcsUrl('apps/spreed/api/v3', 2) + `room/${token}/participants`, { params: { participant: userId, }, @@ -199,7 +199,7 @@ const removeUserFromConversation = async function(token, userId) { const removeGuestFromConversation = async function(token, sessionId) { try { - const response = await axios.delete(generateOcsUrl('apps/spreed/api/v2', 2) + `room/${token}/participants/guests`, { + const response = await axios.delete(generateOcsUrl('apps/spreed/api/v3', 2) + `room/${token}/participants/guests`, { params: { participant: sessionId, }, @@ -211,12 +211,12 @@ const removeGuestFromConversation = async function(token, sessionId) { } const promoteToModerator = async(token, options) => { - const response = await axios.post(generateOcsUrl('apps/spreed/api/v2/room', 2) + token + '/moderators', options) + const response = await axios.post(generateOcsUrl('apps/spreed/api/v3/room', 2) + token + '/moderators', options) return response } const demoteFromModerator = async(token, options) => { - const response = await axios.delete(generateOcsUrl('apps/spreed/api/v2/room', 2) + token + '/moderators', { + const response = await axios.delete(generateOcsUrl('apps/spreed/api/v3/room', 2) + token + '/moderators', { params: options, }) return response @@ -226,7 +226,7 @@ const fetchParticipants = async(token, options) => { options = options || {} options.params = options.params || {} options.params.includeStatus = true - const response = await axios.get(generateOcsUrl('apps/spreed/api/v2/room', 2) + token + '/participants', options) + const response = await axios.get(generateOcsUrl('apps/spreed/api/v3/room', 2) + token + '/participants', options) return response } |