preorder registration is accepted even with wrong unit data

This commit is contained in:
Frank Schubert
2022-10-04 23:03:33 +02:00
parent 5c0d8df911
commit 12ae6d40b7

View File

@@ -173,11 +173,10 @@ class PreorderApicontroller extends mfBaseApicontroller {
$sql = "SELECT * FROM view_wohneinheit WHERE 1=1 $where AND hausnummer_id=".$address->hausnummer_id;
$res = $this->db()->query($sql);
if(!$this->db()->num_rows($res)) {
return mfResponse::NotFound(['message' => "Wohneinheit nicht gefunden"]);
if($this->db()->num_rows($res)) {
$unit = $this->db()->fetch_object($res);
//return mfResponse::NotFound(['message' => "Wohneinheit nicht gefunden"]);
}
$unit = $this->db()->fetch_object($res);
//var_dump($this->db()->num_rows($res), $this->db()->fetch_object($res));
} else {
// if all unit values are empty try to find the unit with all empty values