rediriger l'utilisateur vers la partie en utilisant le code

front
Gwenael PLANCHON 1 year ago
parent fccca1b5c0
commit af7ed37f00

@ -9,7 +9,7 @@ export default {
titreKahoot: "", titreKahoot: "",
nbQuestions: 0, nbQuestions: 0,
//rejoindre partie //rejoindre partie
codeKahoot: "", codeKahootARejoindre: "",
//listes parties crees ( TODO : appeler l'api pour obtenir les parties) //listes parties crees ( TODO : appeler l'api pour obtenir les parties)
partiesCrees: [] partiesCrees: []
}; };
@ -26,10 +26,8 @@ export default {
console.log(this.nbQuestions); console.log(this.nbQuestions);
}, },
// TODO : demander a l'api de rejoindre un kahoot (et rediriger vers la partie si possible via HATEOAS) // TODO : demander a l'api de rejoindre un kahoot (et rediriger vers la partie si possible via HATEOAS)
rejoindrePartie: function () { rejoindrePartie(){
console.log("yay"); this.$router.push(`/kahoot/partie/${this.codeKahootARejoindre}`)
//this.titreKahoot et this.nbQuestions synchronisés avec v-model
console.log(this.codeKahoot);
}, },
async STUB_partiesCrees(){ async STUB_partiesCrees(){
return JSON.parse(`[ return JSON.parse(`[
@ -58,7 +56,7 @@ export default {
</button> </button>
<form @submit.prevent> <form @submit.prevent>
<label for="Kahoot-Code">Code</label> <label for="Kahoot-Code">Code</label>
<input class="form-control bg-light" type="text" id="Kahoot-Code" name="Kahoot-Code" v-model="codeKahoot" minlength="6" maxlength="10"> <input class="form-control bg-light" type="text" id="Kahoot-Code" name="Kahoot-Code" v-model="codeKahootARejoindre" minlength="6" maxlength="10">
<button class="btn btn-light" v-on:click="rejoindrePartie">Rejoindre</button> <button class="btn btn-light" v-on:click="rejoindrePartie">Rejoindre</button>
</form> </form>
</div> </div>

Loading…
Cancel
Save