Commit 051ec16c authored by Rémy Marronnier's avatar Rémy Marronnier

test cors

parent 37c6fb2c
...@@ -2,7 +2,6 @@ import { BAN_API_URL } from "./config"; ...@@ -2,7 +2,6 @@ import { BAN_API_URL } from "./config";
export default function BANService(postcode) { export default function BANService(postcode) {
return fetch(BAN_API_URL.concat(postcode), { return fetch(BAN_API_URL.concat(postcode), {
credentials: 'include',
method: "GET", method: "GET",
headers: { headers: {
'Accept': 'application/json', 'Accept': 'application/json',
......
...@@ -58,6 +58,7 @@ export default { ...@@ -58,6 +58,7 @@ export default {
citycode: null, citycode: null,
validity: false, validity: false,
results: [], results: [],
isLoading: false,
search: null, search: null,
model: null model: null
}), }),
...@@ -111,13 +112,14 @@ export default { ...@@ -111,13 +112,14 @@ export default {
// Lazily load input items // Lazily load input items
BANService(this.address) BANService(this.address)
.then(res => res.json()) .then(res => alert(res.type))
.then(res => { // res.json())
this.results = res.features; // .then(results => {
}) // this.results = results.features;
// .catch(err => {
// //console.log(err);
// }) // })
// // .catch(err => {
// // //console.log(err);
// // })
.finally(() => (this.isLoading = false)); .finally(() => (this.isLoading = false));
} }
} }
......
...@@ -75,8 +75,11 @@ export default { ...@@ -75,8 +75,11 @@ export default {
submitAllocation() { submitAllocation() {
this.validate(); this.validate();
this.$store.dispatch("submitAllocation", this.allocation_type); this.$store.dispatch("submitAllocation", this.allocation_type);
//if value != none OR !retraite... if (this.allocation_type != "none") {
this.$router.push("montant-ARE"); this.$router.push("montant-ARE");
} else {
this.$router.push("votre-age");
}
} }
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment