This commit is contained in:
parent
8d97c34fbe
commit
35bea09857
|
@ -144,6 +144,7 @@ async fn scan_card(
|
|||
Extension(pool): Extension<Database>,
|
||||
Json(scan): Json<ScanRequest>,
|
||||
) -> impl IntoResponse {
|
||||
println!("{:?}", scan);
|
||||
let scanned = pool.is_student_in_party(scan.party, &scan.code).await;
|
||||
if scan.check {
|
||||
if let Some(mut ticket) = scanned {
|
||||
|
|
|
@ -133,7 +133,7 @@
|
|||
});
|
||||
}
|
||||
|
||||
function scan_ticket(code) {
|
||||
function scan_ticket(code, coins) {
|
||||
if (code === "COINS" || code === "000000") {
|
||||
document.getElementById("muntjes").checked = true;
|
||||
return;
|
||||
|
@ -150,7 +150,7 @@
|
|||
party: party_id,
|
||||
code: code,
|
||||
check: check,
|
||||
coins: document.getElementById("muntjes").checked,
|
||||
coins: coins || document.getElementById("muntjes").checked,
|
||||
})
|
||||
}).then(function (response) {
|
||||
return response.json();
|
||||
|
@ -280,10 +280,10 @@
|
|||
coins = true;
|
||||
}
|
||||
}
|
||||
console.log(llnr_a, coins);
|
||||
if (llnr_a !== "") {
|
||||
num++;
|
||||
scan_ticket("COINS");
|
||||
scan_ticket(llnr_a);
|
||||
scan_ticket(llnr_a, coins);
|
||||
}
|
||||
}
|
||||
document.getElementById("import-result").innerHTML = `${num} leerlingen geïmporteerd!`
|
||||
|
|
Loading…
Reference in a new issue