recuperation formation de search a mc
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<div class="box p-3 m-2">
|
||||
<img class="mt-1 ml-5 mr-auto" style="margin: auto;" src="../resources/logo-parcoursup.svg"/>
|
||||
</div>
|
||||
<search></search>
|
||||
<search updateCourse={updateCourse}></search>
|
||||
</div>
|
||||
|
||||
<div class="column">
|
||||
@@ -17,7 +17,17 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
onBeforeMount(props, state) {
|
||||
//Initial state
|
||||
this.state = {
|
||||
formation: null
|
||||
}
|
||||
},
|
||||
updateCourse(formation){
|
||||
this.update({
|
||||
formation: formation
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@@ -36,8 +36,8 @@
|
||||
<script>
|
||||
import PAPI from '../javascript/parcoursup-link.js'
|
||||
|
||||
async function fetchEtablissement(state) {
|
||||
return PAPI.fetchEtablissement(state.fili, state.sousfili, state.soussousfili);
|
||||
async function fetchEtablissement(formation) {
|
||||
return PAPI.fetchEtablissement(formation.fili, formation.sousfili, formation.soussousfili);
|
||||
}
|
||||
|
||||
export default function search() {
|
||||
@@ -45,11 +45,9 @@
|
||||
onBeforeMount(props, state) {
|
||||
this.state = {
|
||||
items: null,
|
||||
fili: "BUT",
|
||||
sousfili: "BUT - Production",
|
||||
soussousfili : "Informatique"
|
||||
formation: this.props.formation
|
||||
}
|
||||
fetchEtablissement(this.state).then((response) => {
|
||||
fetchEtablissement(this.state.formation).then((response) => {
|
||||
this.update({
|
||||
items: response
|
||||
})
|
||||
|
@@ -39,10 +39,10 @@
|
||||
promise = PAPI.fetchFilieres()
|
||||
break
|
||||
case 1:
|
||||
promise = PAPI.fetchFiliere(this.state.filiere)
|
||||
promise = PAPI.fetchFiliere(this.state.course.fili)
|
||||
break
|
||||
case 2:
|
||||
promise = PAPI.fetchSpecialites(this.state.specialite)
|
||||
promise = PAPI.fetchSpecialites(this.state.course.sousfili)
|
||||
break
|
||||
}
|
||||
|
||||
@@ -76,14 +76,18 @@
|
||||
},
|
||||
|
||||
cruiseForward(selection) {
|
||||
if (this.state.currentStep >= 2) return
|
||||
switch (this.state.currentStep) {
|
||||
case 0:
|
||||
this.state.filiere = selection
|
||||
this.state.course.fili = selection
|
||||
break
|
||||
|
||||
case 1:
|
||||
this.state.specialite = selection
|
||||
this.state.course.sousfili = selection
|
||||
break
|
||||
|
||||
case 2:
|
||||
this.state.course.soussousfili = selection
|
||||
this.state.updateCourse(this.state.course)
|
||||
break
|
||||
}
|
||||
|
||||
@@ -106,6 +110,7 @@
|
||||
},
|
||||
|
||||
onBeforeMount(props, state) {
|
||||
console.log("on m'a appelé")
|
||||
//Initial state
|
||||
this.state = {
|
||||
placeholder: PLACEHOLDERS[0],
|
||||
@@ -113,10 +118,12 @@
|
||||
allItems: null,
|
||||
filter: null,
|
||||
items: null,
|
||||
filiere: null,
|
||||
specialite: null,
|
||||
updating: false
|
||||
course: [],
|
||||
updating: false,
|
||||
updateCourse: this.props.updateCourse
|
||||
}
|
||||
console.log(this.state.updateCourse)
|
||||
|
||||
},
|
||||
|
||||
onMounted() {
|
||||
|
Reference in New Issue
Block a user