This commit is contained in:
2024-10-01 23:11:03 +05:00
parent 87a1c2764d
commit 7095880f7a
6 changed files with 51 additions and 32 deletions

View File

@@ -27,33 +27,34 @@ async function fetchCardHistory(passport_serie, passport_id, card_number, card_e
})
.then(response => response.json())
.then(result => {
console.log({result: result})
if (result.errCode != 0) {
Nova.error('Barlap bolmady, tor näsazlygy')
}
cardHistoryDetailContainer.innerHTML = `
<h4 class="mb-4">Şahamça: <strong>${result.depName}, </strong></h4>
// cardHistoryDetailContainer.innerHTML = `
// <h4 class="mb-4">Şahamça: <strong>${result.depName}, </strong></h4>
<p>
<ul>
${Array.from(result.transactions).map(transaction => {
return `<li style="background: #a3c1f5;color: black;" class="p-3 relative rounded-lg">
<strong>${transaction['actionName']}</strong> <strong>${transaction['opersum']}</strong> <strong>${transaction['currency']}</strong>
// <p>
// <ul>
// ${Array.from(result.transactions).map(transaction => {
// return `<li style="background: #a3c1f5;color: black;" class="p-3 relative rounded-lg">
// <strong>${transaction['actionName']}</strong> <strong>${transaction['opersum']}</strong> <strong>${transaction['currency']}</strong>
<strong style="top: 0; right: 0;" class="absolute p-2">${transaction['opername']}</strong>
// <strong style="top: 0; right: 0;" class="absolute p-2">${transaction['opername']}</strong>
<p><strong>${
new Date(transaction['trandate']).toLocaleDateString('en-GB', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
}).replaceAll('/', '.')
}</strong></p>
</li>`;
})}
</ul>
</p>
`;
// <p><strong>${
// new Date(transaction['trandate']).toLocaleDateString('en-GB', {
// year: 'numeric',
// month: '2-digit',
// day: '2-digit',
// }).replaceAll('/', '.')
// }</strong></p>
// </li>`;
// })}
// </ul>
// </p>
// `;
})
.catch(error => console.log('error', error));
}