modified logic in ocr
This commit is contained in:
@@ -882,6 +882,22 @@ function cameraCapture() {
|
||||
this.$refs.hiddenInputSerials.value = JSON.stringify(this.serialNumbers);
|
||||
//this.$refs.serialInput.value = JSON.stringify(this.serialNumbers);
|
||||
alert("Serial numbers stored in hidden input:\n" + this.$refs.serialInput.value);
|
||||
// ✅ Save to Laravel Session using POST API
|
||||
fetch('/save-serials-to-session', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
serial_numbers: this.serialNumbers,
|
||||
}),
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
console.log("✅ Session Updated:", data);
|
||||
alert("✅ Serial numbers saved to session!");
|
||||
})
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("OCR verify error:", err);
|
||||
|
||||
Reference in New Issue
Block a user