From 8d7be399d34bf00b1c85575f6371ed1581c03b5e Mon Sep 17 00:00:00 2001 From: Souptik Datta Date: Fri, 9 Feb 2024 00:15:48 +0530 Subject: [PATCH] fix: Fix project user activity log's missing fields and total count Signed-off-by: Souptik Datta --- app/controllers/api/users.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 38d65fba7e..0765b25fb0 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -615,6 +615,9 @@ App::get('/v1/users/:userId/logs') $output[$i] = new Document([ 'event' => $log['event'], + 'userId' => ID::custom($log['data']['userId']), + 'userEmail' => $log['data']['userEmail'] ?? null, + 'userName' => $log['data']['userName'] ?? null, 'ip' => $log['ip'], 'time' => $log['time'], 'osCode' => $os['osCode'], @@ -643,7 +646,7 @@ App::get('/v1/users/:userId/logs') } $response->dynamic(new Document([ - 'total' => $audit->countLogsByUser($user->getId()), + 'total' => $audit->countLogsByUser($user->getInternalId()), 'logs' => $output, ]), Response::MODEL_LOG_LIST); });