From 9a6ebc94c48d1b42cb5db9a8349bfefc34d34c3f Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Thu, 23 Feb 2023 07:04:12 -0500 Subject: [PATCH] Add support for since_id field into the timeline API --- src/Module/BaseApi.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Module/BaseApi.php b/src/Module/BaseApi.php index 5f1156d771..895cff2b82 100644 --- a/src/Module/BaseApi.php +++ b/src/Module/BaseApi.php @@ -139,11 +139,12 @@ class BaseApi extends BaseModule $condition = DBA::mergeConditions($condition, ["`$order_field` < ?", DateTimeFormat::convert($request['max_id'], DateTimeFormat::MYSQL)]); } + if (!empty($request['since_id'])) { + $condition = DBA::mergeConditions($condition, ["`$order_field` > ?", DateTimeFormat::convert($request['since_id'], DateTimeFormat::MYSQL)]); + } if (!empty($request['min_id'])) { $condition = DBA::mergeConditions($condition, ["`$order_field` > ?", DateTimeFormat::convert($request['min_id'], DateTimeFormat::MYSQL)]); - - $params['order'] = [$order_field]; } }