From f8853f1baa98c500e594863492d390ab6954cd08 Mon Sep 17 00:00:00 2001 From: uo288120 <145131850+Pedro-C-M@users.noreply.github.com> Date: Tue, 30 Apr 2024 20:59:47 +0200 Subject: [PATCH] Arreglo llamada a ranking --- webapp/src/components/game/gameModes/DailyGameMode.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/webapp/src/components/game/gameModes/DailyGameMode.js b/webapp/src/components/game/gameModes/DailyGameMode.js index 34e9925..f1e59ec 100644 --- a/webapp/src/components/game/gameModes/DailyGameMode.js +++ b/webapp/src/components/game/gameModes/DailyGameMode.js @@ -36,13 +36,19 @@ class DailyGameMode extends BasicGame{ async incrementAcertadas(){ try { + const volverJugarData = { + user: null, + fecha : this.fechaAct + }; + //sacar del localStorage el usuario + volverJugarData.user = localStorage.getItem('username'); console.log("enviar historial trycatch"); const response = await fetch(`${this.apiEndpoint}/updateHistoryDiaria`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify("{user: "+ localStorage.getItem('username') +"}") + body: JSON.stringify(volverJugarData) }); const data = await response.json(); console.log('Historial enviado:', data);