updates kontakt_id / adresse_id in profilUpdateRequest after inserting new kontakt/adresse in db

This commit is contained in:
SimonGschnell
2024-01-25 16:43:47 +01:00
parent 20672cd311
commit 15cd9155f1
7 changed files with 68 additions and 30 deletions
+1 -1
View File
@@ -115,7 +115,7 @@ class Profil extends Auth_Controller
$existing_change = json_decode($update_request->requested_change);
if(property_exists($existing_change,$type) && property_exists($payload,$type) && $existing_change->$type == $payload->$type){
if(!isset($existing_change->add) && property_exists($existing_change,$type) && property_exists($payload,$type) && $existing_change->$type == $payload->$type){
//? the kontakt_id / adresse_id of a change has to be unique
echo json_encode(error("cannot change the same resource twice"));