Fixed coordinates api query
This commit is contained in:
parent
13f37a14e8
commit
0c47fd2338
@ -15,7 +15,8 @@ function getHome(req, res) {
|
|||||||
|
|
||||||
function quizz(req, res) {
|
function quizz(req, res) {
|
||||||
debug('Generating quizz');
|
debug('Generating quizz');
|
||||||
const { lat, lng } = req.body;
|
const { lat, lng } = req.query;
|
||||||
|
debug(`Coordinates: ${lat}, ${lng}`);
|
||||||
const locale = req.i18n.locale;
|
const locale = req.i18n.locale;
|
||||||
debugLocale("Locale:", locale);
|
debugLocale("Locale:", locale);
|
||||||
quizzController.generateQuizz({ lat, lng }, locale, QUIZZ_SIZE)
|
quizzController.generateQuizz({ lat, lng }, locale, QUIZZ_SIZE)
|
||||||
|
@ -19,7 +19,9 @@ function quizzStep() {
|
|||||||
|
|
||||||
// Retrieve coordinates from former done geolocation (TODO: fix the need of cookie)
|
// Retrieve coordinates from former done geolocation (TODO: fix the need of cookie)
|
||||||
const coordinates = getCoordinates();
|
const coordinates = getCoordinates();
|
||||||
client.getQuizz(coordinates)
|
const [lat, lng] = coordinates;
|
||||||
|
console.log("Coordinates: " + `${lat}, ${lng}`);
|
||||||
|
client.getQuizz(lat, lng)
|
||||||
.then(quizz => {
|
.then(quizz => {
|
||||||
// Display the quizz
|
// Display the quizz
|
||||||
displayQuizz(quizz);
|
displayQuizz(quizz);
|
||||||
|
Loading…
Reference in New Issue
Block a user