Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

baseline api: pass timestamps separately to representer rather than with the query params

Sebastian Fiedlschusterf14f64e195d8
diff --git a/lib/api/v3/work_packages/work_package_collection_representer.rb b/lib/api/v3/work_packages/work_package_collection_representer.rb
index 90a12cdb4a5..3db7a34a38c 100644
--- a/lib/api/v3/work_packages/work_package_collection_representer.rb
+++ b/lib/api/v3/work_packages/work_package_collection_representer.rb
@@ -48,13 +48,15 @@ module API
@total_sums = total_sums
@embed_schemas = embed_schemas
@timestamps = timestamps
- @_query = _query
# While `_query` is the actual query object, `query` refers to
# the query parameters passed to the API.
+ #
# TODO: Should we rename `_query` to `query_object`?
# TODO: Should we rename `query` to `query_params`?
- # TODO: Should we include the timestamps in the query params instead of passing them separately?
+ #
+ @_query = _query
+
if timestamps.present? && (timestamps.count > 1 or timestamps.first.historic?)
query[:timestamps] ||= API::V3::Utilities::PathHelper::ApiV3Path.timestamps_to_param_value(timestamps)
end