diff --git a/src/components/forms/department/pos/input/LicensePlateReg1Input.vue b/src/components/forms/department/pos/input/LicensePlateReg1Input.vue
index 434fcf7a..e5b829ba 100644
--- a/src/components/forms/department/pos/input/LicensePlateReg1Input.vue
+++ b/src/components/forms/department/pos/input/LicensePlateReg1Input.vue
@@ -106,7 +106,7 @@ const searchVehicle = async ( inputValue, search_id ) => {
}
).then(response => {
if (!is_latest_search(search_id)) {
- return
+ return;
}
let result = response?.data?.data;
if (result && result.length > 0) {
@@ -168,8 +168,7 @@ const getUnregisteredVehicleObjects = (inputValue, search_id) => {
// Set the vehicles_matching array to include both registered and unregistered vehicles
vehicles_matching.value = [...vehicles_matching.value, ...unregistered_vehicles];
} else {
- // If no results, clear the vehicles_matching array
- vehicles_matching.value = [];
+ // Do nothing
}
}).catch(error => {
console.error("Error:", error, search_id);
@@ -222,12 +221,12 @@ const selectVehicle = (vehicle_id) => {
if (vehicle) {
// If a vehicle is found, set the reg_1 value to the vehicle's reg
reg_1.value = vehicle.reg;
- // Optionally, you can also set other properties like customer_id, etc.
- customer_id.value = vehicle.customer_id;
getCustomerName(vehicle.customer_id);
if (vehicle.customer_id) {
// If the vehicle has a customer ID, search and select the customer
// This is to prevent the unregistered vehicle from trying to select an unknown customer
+ // Optionally, you can also set other properties like customer_id, etc.
+ customer_id.value = vehicle.customer_id;
searchAndSelectCustomer(vehicle.customer_id);
}
// Emit the vehicle object to the parent component