Add TODOs for view audit logs. #330
This commit is contained in:
parent
afeb06006d
commit
025e14ff69
1 changed files with 2 additions and 14 deletions
|
|
@ -502,30 +502,18 @@ class UserController extends Controller
|
|||
|
||||
public function getLogs(Client $client, $id)
|
||||
{
|
||||
error_log('in getLogs');
|
||||
|
||||
// fetch database
|
||||
// TODO: find way to replace hardcoded db name
|
||||
$database = $client->selectDB('logging_db');
|
||||
|
||||
// query will return a resultset object
|
||||
// TODO: filter query using user id
|
||||
$result = $database->query('SELECT * FROM entity_log');
|
||||
|
||||
// get the points from the resultset, which is an array
|
||||
$points = $result->getPoints();
|
||||
|
||||
error_log('getLogs count points ' . count($points));
|
||||
|
||||
// array has format
|
||||
/*
|
||||
$rows = [];
|
||||
foreach ($points as $point)
|
||||
{
|
||||
$row['time'] = $point['time'];
|
||||
error_log($point['entity_type']);
|
||||
|
||||
error_log($point['action']);
|
||||
} */
|
||||
// TODO: might need to format time data
|
||||
|
||||
return $this->json([
|
||||
'data' => $points,
|
||||
|
|
|
|||
Loading…
Reference in a new issue