From 6f854b5eb6ba084ca6dc3aef819fe0b9c685376a Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 25 Feb 2025 18:18:25 +1300 Subject: [PATCH] Remove blocks --- app/controllers/api/account.php | 6 ++---- app/controllers/api/databases.php | 18 ++++++------------ app/controllers/api/messaging.php | 24 ++++++++---------------- app/controllers/api/teams.php | 6 ++---- app/controllers/api/users.php | 6 ++---- 5 files changed, 20 insertions(+), 40 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index bef26ad25c..21a04800b5 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -2750,10 +2750,8 @@ App::get('/v1/account/logs') } $response->dynamic(new Document([ - //'total' => $audit->countLogsByUser($user->getInternalId()), - //'logs' => $output, - 'total' => 0, - 'logs' => [], + 'total' => $audit->countLogsByUser($user->getInternalId()), + 'logs' => $output, ]), Response::MODEL_LOG_LIST); }); diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index d9d62eac51..c563d1e8e0 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -723,10 +723,8 @@ App::get('/v1/databases/:databaseId/logs') } $response->dynamic(new Document([ - //'total' => $audit->countLogsByResource($resource), - //'logs' => $output, - 'total' => 0, - 'logs' => [], + 'total' => $audit->countLogsByResource($resource), + 'logs' => $output, ]), Response::MODEL_LOG_LIST); }); @@ -1114,10 +1112,8 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/logs') } $response->dynamic(new Document([ - //'total' => $audit->countLogsByResource($resource), - //'logs' => $output, - 'total' => 0, - 'logs' => [], + 'total' => $audit->countLogsByResource($resource), + 'logs' => $output, ]), Response::MODEL_LOG_LIST); }); @@ -3767,10 +3763,8 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen } $response->dynamic(new Document([ - //'total' => $audit->countLogsByResource($resource), - //'logs' => $output, - 'total' => 0, - 'logs' => [], + 'total' => $audit->countLogsByResource($resource), + 'logs' => $output, ]), Response::MODEL_LOG_LIST); }); diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index 06d49394aa..d7d3750ccf 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -1047,10 +1047,8 @@ App::get('/v1/messaging/providers/:providerId/logs') } $response->dynamic(new Document([ - //'total' => $audit->countLogsByResource($resource), - //'logs' => $output, - 'total' => 0, - 'logs' => [], + 'total' => $audit->countLogsByResource($resource), + 'logs' => $output, ]), Response::MODEL_LOG_LIST); }); @@ -2278,10 +2276,8 @@ App::get('/v1/messaging/topics/:topicId/logs') } $response->dynamic(new Document([ - //'total' => $audit->countLogsByResource($resource), - //'logs' => $output, - 'total' => 0, - 'logs' => [], + 'total' => $audit->countLogsByResource($resource), + 'logs' => $output, ]), Response::MODEL_LOG_LIST); }); @@ -2690,10 +2686,8 @@ App::get('/v1/messaging/subscribers/:subscriberId/logs') } $response->dynamic(new Document([ - //'total' => $audit->countLogsByResource($resource), - //'logs' => $output, - 'total' => 0, - 'logs' => [], + 'total' => $audit->countLogsByResource($resource), + 'logs' => $output, ]), Response::MODEL_LOG_LIST); }); @@ -3457,10 +3451,8 @@ App::get('/v1/messaging/messages/:messageId/logs') } $response->dynamic(new Document([ - //'total' => $audit->countLogsByResource($resource), - //'logs' => $output, - 'total' => 0, - 'logs' => [], + 'total' => $audit->countLogsByResource($resource), + 'logs' => $output, ]), Response::MODEL_LOG_LIST); }); diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 7a9f21d74b..763aca64f0 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -1415,9 +1415,7 @@ App::get('/v1/teams/:teamId/logs') } } $response->dynamic(new Document([ - //'total' => $audit->countLogsByResource($resource), - //'logs' => $output, - 'total' => 0, - 'logs' => [], + 'total' => $audit->countLogsByResource($resource), + 'logs' => $output, ]), Response::MODEL_LOG_LIST); }); diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index ca3f042ba4..962022927f 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -915,10 +915,8 @@ App::get('/v1/users/:userId/logs') } $response->dynamic(new Document([ - //'total' => $audit->countLogsByUser($user->getInternalId()), - //'logs' => $output, - 'total' => 0, - 'logs' => [], + 'total' => $audit->countLogsByUser($user->getInternalId()), + 'logs' => $output, ]), Response::MODEL_LOG_LIST); });