|
@@ -30,6 +30,7 @@
|
|
|
<td class="modal-td" v-show="false">
|
|
|
<portal :to="`modal-view-${hero._id}`">
|
|
|
<Modal
|
|
|
+ @submitted="activateHero($event, hero._id)"
|
|
|
:ref="`modal-${hero._id}`"
|
|
|
:showButton="false"
|
|
|
actionTitle="Make Active"
|
|
@@ -77,6 +78,15 @@ export default {
|
|
|
openModal(modalId) {
|
|
|
const modal = this.$refs[`modal-${modalId}`][0]
|
|
|
modal.openModal()
|
|
|
+ },
|
|
|
+ async activateHero({ closeModal },heroId) {
|
|
|
+ try{
|
|
|
+ const result = await this.$store.dispatch('instructor/activateHero', heroId)
|
|
|
+ this.$toasted.success('Hero was succesfuly activated!', {duration: 2000})
|
|
|
+ closeModal()
|
|
|
+ }catch(error){
|
|
|
+ this.$toasted.success('Hero was activated fail!', {duration: 2000})
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|