Fixed coordinates api query

This commit is contained in:
Samuel Ortion 2022-09-03 21:52:02 +02:00
parent 13f37a14e8
commit 0c47fd2338
2 changed files with 5 additions and 2 deletions

View File

@ -15,7 +15,8 @@ function getHome(req, res) {
function quizz(req, res) {
debug('Generating quizz');
const { lat, lng } = req.body;
const { lat, lng } = req.query;
debug(`Coordinates: ${lat}, ${lng}`);
const locale = req.i18n.locale;
debugLocale("Locale:", locale);
quizzController.generateQuizz({ lat, lng }, locale, QUIZZ_SIZE)

View File

@ -19,7 +19,9 @@ function quizzStep() {
// Retrieve coordinates from former done geolocation (TODO: fix the need of cookie)
const coordinates = getCoordinates();
client.getQuizz(coordinates)
const [lat, lng] = coordinates;
console.log("Coordinates: " + `${lat}, ${lng}`);
client.getQuizz(lat, lng)
.then(quizz => {
// Display the quizz
displayQuizz(quizz);