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)
|
public function getLogs(Client $client, $id)
|
||||||
{
|
{
|
||||||
error_log('in getLogs');
|
|
||||||
|
|
||||||
// fetch database
|
// fetch database
|
||||||
// TODO: find way to replace hardcoded db name
|
// TODO: find way to replace hardcoded db name
|
||||||
$database = $client->selectDB('logging_db');
|
$database = $client->selectDB('logging_db');
|
||||||
|
|
||||||
// query will return a resultset object
|
// query will return a resultset object
|
||||||
|
// TODO: filter query using user id
|
||||||
$result = $database->query('SELECT * FROM entity_log');
|
$result = $database->query('SELECT * FROM entity_log');
|
||||||
|
|
||||||
// get the points from the resultset, which is an array
|
// get the points from the resultset, which is an array
|
||||||
$points = $result->getPoints();
|
$points = $result->getPoints();
|
||||||
|
|
||||||
error_log('getLogs count points ' . count($points));
|
// TODO: might need to format time data
|
||||||
|
|
||||||
// array has format
|
|
||||||
/*
|
|
||||||
$rows = [];
|
|
||||||
foreach ($points as $point)
|
|
||||||
{
|
|
||||||
$row['time'] = $point['time'];
|
|
||||||
error_log($point['entity_type']);
|
|
||||||
|
|
||||||
error_log($point['action']);
|
|
||||||
} */
|
|
||||||
|
|
||||||
return $this->json([
|
return $this->json([
|
||||||
'data' => $points,
|
'data' => $points,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue