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

@ -52,23 +52,26 @@ document.addEventListener('DOMContentLoaded', () => {
if (type === 'combat') { if (type === 'combat') {
const id1 = selectedCards[0].dataset.id; const id1 = selectedCards[0].dataset.id;
const id2 = selectedCards[1].dataset.id; const id2 = selectedCards[1].dataset.id;
const t1 = 2; const t1 = 4;
const t2 = 3 const t2 = 6;
console.log(`Combat : ${name1} contre ${name2}`); 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}`; //window.location.href = `/emoji/fight/${id1}/${id2}`;
/*fetch(`/pim/popim/${id}`, { fetch(`/emoji/fight/${t2}/${t1}`, { method: 'GET',
method: 'GET',
headers: { headers: {
'Accept': 'application/json' // ou 'text/html' selon ta route 'Accept': 'application/json'
} }}).then(response => {
})
.then(response => {
if (!response.ok) { if (!response.ok) {
throw new Error(`Erreur HTTP ${response.status}`); 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') { } else if (type === 'reproduction') {
console.log(`Accouplement : ${name1} et ${name2}`); console.log(`Accouplement : ${name1} et ${name2}`);

Loading…
Cancel
Save