Commit e659e774fe39f99d22ea69d061e1a71b1b412da5
1 parent
b5fb2daea3
Exists in
master
and in
1 other branch
integrate updateLiveClass API
Showing
1 changed file
with
20 additions
and
2 deletions
Show diff stats
src/pages/Dashboard/LiveOnlineClass.vue
... | ... | @@ -45,7 +45,7 @@ |
45 | 45 | v-if="studentBtn" |
46 | 46 | @click="showLoader = true;startChat();" |
47 | 47 | >{{studentBtn}}</v-btn> |
48 | - <span class="subheading grey--twxt lighten-1" v-else>Session hasnt started yet</span> | |
48 | + <span class="subheading grey--twxt lighten-1" v-else>Session hasn't started yet</span> | |
49 | 49 | </div> |
50 | 50 | </v-flex> |
51 | 51 | <v-flex id="studentClone"> |
... | ... | @@ -161,7 +161,7 @@ export default { |
161 | 161 | room: "", |
162 | 162 | username: "", |
163 | 163 | roomPassword: "", |
164 | - counter: 0, | |
164 | + // counter: 0, | |
165 | 165 | appLink: "", |
166 | 166 | showStartSessionButton: true, |
167 | 167 | showJoinSessionButton: true, |
... | ... | @@ -261,6 +261,9 @@ export default { |
261 | 261 | jitsi.innerHTML = ""; |
262 | 262 | this.showStartSessionButton = true; |
263 | 263 | this.showJoinSessionButton = true; |
264 | + if (this.$store.state.role === "TEACHER") { | |
265 | + this.updateLiveClass(); | |
266 | + } | |
264 | 267 | }); |
265 | 268 | } catch (error) { |
266 | 269 | // console.error("Failed to load Jitsi API", error); |
... | ... | @@ -297,6 +300,7 @@ export default { |
297 | 300 | var username = localStorage.getItem("teacherName"); |
298 | 301 | var roomPassword = response.data.data.password; |
299 | 302 | this.appLink = response.data.data.appLink; |
303 | + this.liveClassId = response.data.data._id; | |
300 | 304 | // console.log( |
301 | 305 | // "room", |
302 | 306 | // room, |
... | ... | @@ -338,6 +342,20 @@ export default { |
338 | 342 | this.showLoader = false; |
339 | 343 | }); |
340 | 344 | }, |
345 | + updateLiveClass() { | |
346 | + this.showLoader = true; | |
347 | + var payloadData = { | |
348 | + liveClassesId: this.liveClassId, | |
349 | + }; | |
350 | + http() | |
351 | + .put("/updateLiveClasses", payloadData) | |
352 | + .then((response) => { | |
353 | + this.showLoader = false; | |
354 | + }) | |
355 | + .catch((error) => { | |
356 | + this.showLoader = false; | |
357 | + }); | |
358 | + }, | |
341 | 359 | async studentClasses() { |
342 | 360 | this.liveLink = ""; |
343 | 361 | this.room = ""; | ... | ... |