Fixed visibility-filter endpoint

This commit is contained in:
Maximilian Giller 2021-04-13 19:10:12 +02:00
parent 978fa507bd
commit 2525b3c805

View file

@ -163,7 +163,10 @@ function getRunningRecords($user_id)
function getRecords($user_id, $limit = NULL, $finished = NULL, $visible = NULL) function getRecords($user_id, $limit = NULL, $finished = NULL, $visible = NULL)
{ {
$db = new DbOperations(); $db = new DbOperations();
$db->select("time_records"); $db->select("time_records", ["record_id", "start_time", "end_time", "duration", "user_id", "project_id", "start_device_id"]);
if ($visible != NULL) {
$db->innerJoin("projects", "project_id");
}
$db->where("user_id", Comparison::EQUAL, $user_id); $db->where("user_id", Comparison::EQUAL, $user_id);
if ($finished != NULL) { if ($finished != NULL) {
if ($finished) { if ($finished) {