From 73831b6de6a5d7b2c7c95572e492456ed7d6908f Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Wed, 14 Dec 2022 15:08:40 +0100 Subject: [PATCH] Fixed existing preorders not ignoring deleted preorder in POST /preorder --- application/Api/v1/PreorderApicontroller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/Api/v1/PreorderApicontroller.php b/application/Api/v1/PreorderApicontroller.php index d1674ce3e..f21e991e6 100644 --- a/application/Api/v1/PreorderApicontroller.php +++ b/application/Api/v1/PreorderApicontroller.php @@ -346,7 +346,7 @@ class PreorderApicontroller extends mfBaseApicontroller { * check if there is an existing preorder for this unit already */ if($unit && $unit->wohneinheit_id) { - $existing_preorder = PreorderModel::getFirst(['adb_wohneinheit_id' => $unit->wohneinheit_id]); + $existing_preorder = PreorderModel::getFirst(['adb_wohneinheit_id' => $unit->wohneinheit_id, 'deleted' => 0]); if($existing_preorder) { return mfResponse::Forbidden(['message' => "Für diese Wohneinheit liegt bereits eine Bestellung vor"]); }