mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix: users audit logs
This commit is contained in:
@@ -287,26 +287,8 @@ App::get('/v1/users/:userId/logs')
|
||||
}
|
||||
|
||||
$audit = new Audit($dbForProject);
|
||||
$auditEvents = [
|
||||
'account.create',
|
||||
'account.delete',
|
||||
'account.update.name',
|
||||
'account.update.email',
|
||||
'account.update.password',
|
||||
'account.update.prefs',
|
||||
'account.sessions.create',
|
||||
'account.sessions.update',
|
||||
'account.sessions.delete',
|
||||
'account.recovery.create',
|
||||
'account.recovery.update',
|
||||
'account.verification.create',
|
||||
'account.verification.update',
|
||||
'teams.membership.create',
|
||||
'teams.membership.update',
|
||||
'teams.membership.delete',
|
||||
];
|
||||
|
||||
$logs = $audit->getLogsByUserAndEvents($user->getId(), $auditEvents, $limit, $offset);
|
||||
$logs = $audit->getLogsByUser($user->getId(), $limit, $offset);
|
||||
|
||||
$output = [];
|
||||
|
||||
@@ -354,7 +336,7 @@ App::get('/v1/users/:userId/logs')
|
||||
;
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'total' => $audit->countLogsByUserAndEvents($user->getId(), $auditEvents),
|
||||
'total' => $audit->countLogsByUser($user->getId()),
|
||||
'logs' => $output,
|
||||
]), Response::MODEL_LOG_LIST);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user