From 12ae6d40b7365998fcc49d1db3cb37a7c62af357 Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Tue, 4 Oct 2022 23:03:33 +0200 Subject: [PATCH] preorder registration is accepted even with wrong unit data --- application/Api/v1/PreorderApicontroller.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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