diff --git a/app/Http/Controllers/Client/RegSysClientController.php b/app/Http/Controllers/Client/RegSysClientController.php index 5ad585f..21692b9 100644 --- a/app/Http/Controllers/Client/RegSysClientController.php +++ b/app/Http/Controllers/Client/RegSysClientController.php @@ -103,7 +103,13 @@ public static function getSingleReg(string|null $reg_id): mixed ]); if ($response->ok()) { - return $response->json('result')[0]; + if (!empty($response->json('result'))) { + return $response->json('result')[0]; + } else { + // If reg ID is invalid, regsys returns HTTP 200 but an empty array. + self::logError("Registration with id " . $reg_id . " could not be retrieved, reg id invalid."); + return null; + } } else { self::logError("Registration with id " . $reg_id . " could not be retrieved, reason: " . $response->reason()); return null; diff --git a/app/Models/Application.php b/app/Models/Application.php index 83caf88..467af42 100644 --- a/app/Models/Application.php +++ b/app/Models/Application.php @@ -312,6 +312,7 @@ public static function getAllApplicationsForExport() 'applications.id AS app_id', 'users.name AS user_name', 'users.email AS email', + 'users.reg_id AS reg_id', 'type AS app_type', 'parent', 'display_name',