MSIN-4468 — Enhance quantity validation in AJAX and JavaScript for race management. Implement error handling for total quantity below registrations and update related UI elements. Increment version code to 4.72.853.
This commit is contained in:
@ -2294,6 +2294,12 @@
|
||||
if (elInscrits) {
|
||||
elInscrits.textContent = row.qte_inscrits;
|
||||
}
|
||||
let gestionPanel = document.querySelector(
|
||||
'.epr-gestion-panel[data-epr-id="' + eprId + '"]'
|
||||
);
|
||||
if (gestionPanel && row.qte_inscrits !== undefined) {
|
||||
gestionPanel.dataset.qteInscrits = row.qte_inscrits;
|
||||
}
|
||||
if (elCheckin) {
|
||||
elCheckin.textContent = row.qte_checkin;
|
||||
}
|
||||
@ -2345,6 +2351,15 @@
|
||||
return;
|
||||
}
|
||||
|
||||
let gestionPanel = btn.closest('.epr-gestion-panel');
|
||||
let intNbInscriptions = gestionPanel
|
||||
? parseInt(gestionPanel.dataset.qteInscrits, 10) || 0
|
||||
: 0;
|
||||
if (intQteTotale < intNbInscriptions) {
|
||||
alert(bibJsFmt('jsQteTotalMin', intNbInscriptions));
|
||||
return;
|
||||
}
|
||||
|
||||
bibLoaderShow();
|
||||
fetch('/ajax_promoteur.php', {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user