Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/csv export regsys #15

Merged
merged 2 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion app/Http/Controllers/Client/RegSysClientController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions app/Models/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down