|
|
|
@ -39,7 +39,8 @@ module Api |
|
|
|
|
|
|
|
|
|
before_filter :find_project_by_project_id, |
|
|
|
|
:authorize, :except => [:index] |
|
|
|
|
before_filter :parse_changed_since, only: [:index] |
|
|
|
|
before_filter :parse_changed_since, |
|
|
|
|
:parse_work_package_ids, only: [:index] |
|
|
|
|
before_filter :assign_planning_elements, :except => [:index, :update, :create] |
|
|
|
|
|
|
|
|
|
# Attention: find_all_projects_by_project_id needs to mimic all of the above |
|
|
|
@ -261,6 +262,8 @@ module Api |
|
|
|
|
.changed_since(@since) |
|
|
|
|
.includes(:status, :project, :type, :custom_values) |
|
|
|
|
|
|
|
|
|
work_packages = work_packages.where(id: @wp_ids) if @wp_ids |
|
|
|
|
|
|
|
|
|
if params[:f] |
|
|
|
|
#we need a project to make project-specific custom fields work |
|
|
|
|
project = timeline_to_project(params[:timeline]) |
|
|
|
@ -343,6 +346,10 @@ module Api |
|
|
|
|
def parse_changed_since |
|
|
|
|
@since = Time.at(Float(params[:changed_since] || 0).to_i) rescue render_400 |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def parse_work_package_ids |
|
|
|
|
@wp_ids = params[:ids] ? params[:ids].split(',') : nil |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|