Skip to content

Commit

Permalink
Arreglo llamada a ranking
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro-C-M committed Apr 30, 2024
1 parent 4dc9699 commit f8853f1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion webapp/src/components/game/gameModes/DailyGameMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f8853f1

Please sign in to comment.