raph_combat
Raphael LACOTE 3 days ago
parent 4713eab595
commit 318734b2f2

@ -52,23 +52,26 @@ document.addEventListener('DOMContentLoaded', () => {
if (type === 'combat') {
const id1 = selectedCards[0].dataset.id;
const id2 = selectedCards[1].dataset.id;
const t1 = 2;
const t2 = 3
const t1 = 4;
const t2 = 6;
console.log(`Combat : ${name1} contre ${name2}`);
window.location.href = `/emoji/fight/${t2}/${t1}`;
//window.location.href = `/emoji/fight/${t2}/${t1}`;
//window.location.href = `/emoji/fight/${id1}/${id2}`;
/*fetch(`/pim/popim/${id}`, {
method: 'GET',
fetch(`/emoji/fight/${t2}/${t1}`, { method: 'GET',
headers: {
'Accept': 'application/json' // ou 'text/html' selon ta route
}
})
.then(response => {
'Accept': 'application/json'
}}).then(response => {
if (!response.ok) {
throw new Error(`Erreur HTTP ${response.status}`);
}
return response.json(); // ou response.text() selon le retour attendu
})*/
return response.json();
})
.then(data => {
console.log('Données reçues :', data);
})
.catch(error => {
console.error('Erreur lors de la requête :', error);
});
} else if (type === 'reproduction') {
console.log(`Accouplement : ${name1} et ${name2}`);

Loading…
Cancel
Save