diff --git a/application/Api/v1/PreorderApicontroller.php b/application/Api/v1/PreorderApicontroller.php index 73af6f17c..987db6dc2 100644 --- a/application/Api/v1/PreorderApicontroller.php +++ b/application/Api/v1/PreorderApicontroller.php @@ -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