terminate with error if receiver person_id or prestudent_id is not found

This commit is contained in:
Harald Bamberger
2025-08-19 17:18:57 +02:00
parent 1c86a6ad55
commit 905a2dadff
@@ -418,6 +418,10 @@ class Messages extends FHCAPI_Controller
}
$data = $this->getDataOrTerminateWithError($result);
if (count($data) < 1)
{
$this->terminateWithError('Error: Messages API no person_id found.');
}
$person = current($data);
return $person->person_id;
@@ -432,8 +436,12 @@ class Messages extends FHCAPI_Controller
);
$data = $this->getDataOrTerminateWithError($result);
if (count($data) < 1)
{
$this->terminateWithError('Error: Messages API no prestudent_id found.');
}
$student = current($data);
// $this->terminateWithError($student->prestudent_id, self::ERROR_TYPE_GENERAL);
return $student->prestudent_id;
}