Update adminReportController, fix mail verification request 500 bug by changing filter precedence to catch deleted users that may still be cached in AccountService

This commit is contained in:
Daniel Supernault 2022-05-16 02:16:23 -06:00
parent 0a7a061a83
commit 3f322e29d7
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -528,11 +528,14 @@ trait AdminReportController
return !in_array($id, $ignored);
})
->map(function($id) {
$account = AccountService::get($id);
$user = User::whereProfileId($id)->first();
if(!$user) {
return [];
}
$account = AccountService::get($id);
if(!$account) {
return [];
}
$account['email'] = $user->email;
return $account;
})