Skip to content

Commit

Permalink
[#24] wip: leaveSession
Browse files Browse the repository at this point in the history
  • Loading branch information
Talia2019 committed Feb 3, 2022
1 parent 4d78d69 commit f26193e
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions src/components/meetingroom/VideoRoomComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import UserModel from '../../models/user-model';
import ToolbarComponent from './toolbar/ToolbarComponent';

var localUser = new UserModel();
var sessionToken;

class VideoRoomComponent extends Component {
constructor(props) {
Expand Down Expand Up @@ -225,20 +226,32 @@ class VideoRoomComponent extends Component {
// this.props.leaveSession();
// }
return new Promise((resolve, reject) => {
var data = JSON.stringify({});
// var data = JSON.stringify({
// sessionToken: sessionToken,
// logMeeting: '40',
// logStartTime: '06:58:40'
// });
console.log("sessiontoken: ", sessionToken);
const token = localStorage.getItem("accessToken");
axios
.delete('/meetings/1/room', data, {
.delete('/meetings/1/room',
{ data: { sessionToken: sessionToken,
logMeeting: 40,
logStartTime: '06:58:40'
},

headers: {
Authorization: 'Bearer ' + token,
'Content-Type': 'application/json',
},
})
}})
.then((response) => {
console.log('TOKEN', response);
console.log('Leave', response);
resolve(response.data.token);
})
.catch((error) => reject(error));
.catch((error) => {
console.log("LEAVE ERROR : " + error);
reject(error)
});
});


Expand Down Expand Up @@ -598,6 +611,7 @@ class VideoRoomComponent extends Component {
.then((response) => {
console.log('CREATE SESION', response);
resolve(response.data.id);
// console.log('URL' + )
})
.catch((response) => {
var error = Object.assign({}, response);
Expand Down Expand Up @@ -640,6 +654,7 @@ class VideoRoomComponent extends Component {
.then((response) => {
console.log('TOKEN', response);
resolve(response.data.sessionToken);
sessionToken = response.data.sessionToken;
})
.catch((error) => reject(error));
});
Expand Down

0 comments on commit f26193e

Please sign in to comment.