diff --git a/services/nginx/app/objects/department_selfserve_vehicle_conditions_o.php b/services/nginx/app/objects/department_selfserve_vehicle_conditions_o.php index e94fa9fd..7b13c157 100644 --- a/services/nginx/app/objects/department_selfserve_vehicle_conditions_o.php +++ b/services/nginx/app/objects/department_selfserve_vehicle_conditions_o.php @@ -53,6 +53,9 @@ class department_selfserve_vehicle_conditions_o extends db $question = (int)$question; $value = (bool)$value; $customer_id = $customer_id !== null ? (int)$customer_id : null; + // Remove any existing entry for the same department, lane, reg and question + $sql = "DELETE FROM $this->table WHERE department = $department AND lane = $lane AND reg = '$reg' AND question = $question"; + $db->query($sql); // Add the object $tmp_id = self::add_object([ 'department' => $department,