Fix csv import logic
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Julius 2022-11-12 22:36:08 +01:00
parent 8d97c34fbe
commit 35bea09857
Signed by: j00lz
GPG key ID: AF241B0AA237BBA2
2 changed files with 5 additions and 4 deletions

View file

@ -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 {

View file

@ -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!`