fix(cardassignment): handle card not found

This commit is contained in:
Philipp Dormann 2025-04-23 11:01:06 +02:00
parent 3cedbebe40
commit 6c986467d3
Signed by: philipp
GPG Key ID: 3BB9ADD52DCA4314

View File

@ -433,7 +433,7 @@
state = "assigning"; state = "assigning";
RunnerCardService.runnerCardControllerGetAll() RunnerCardService.runnerCardControllerGetAll()
.then((cards) => { .then((cards) => {
console.log(cards); // console.log(cards);
const card = cards.find((c) => c.code === cardCode); const card = cards.find((c) => c.code === cardCode);
if (card) { if (card) {
console.log("card found", card); console.log("card found", card);
@ -450,7 +450,10 @@
scannerActive = false; scannerActive = false;
}); });
} else { } else {
scannerActive = true; console.log("card not found");
// scannerActive = true;
state = "error_card";
scannerActive = false;
} }
}) })
.catch(() => { .catch(() => {