removes planning_element api list action - never used

pull/396/head
Jens Ulferts 11 years ago committed by Hagen Schink
parent 60e6ea46dd
commit 060f5e1ce9
  1. 24
      app/controllers/api/v2/planning_elements_controller.rb
  2. 2
      config/routes.rb

@ -20,8 +20,8 @@ module Api
include ExtendedHTTP
before_filter :find_project_by_project_id,
:authorize, :except => [:index, :list]
before_filter :assign_planning_elements, :except => [:index, :list, :update, :create]
:authorize, :except => [:index]
before_filter :assign_planning_elements, :except => [:index, :update, :create]
# Attention: find_all_projects_by_project_id needs to mimic all of the above
# before filters !!!
@ -30,7 +30,7 @@ module Api
helper :timelines
helper :timelines_journals
accept_key_auth :index, :create, :show, :update, :destroy, :list
accept_key_auth :index, :create, :show, :update, :destroy
def index
optimize_planning_elements_for_less_db_queries
@ -97,24 +97,6 @@ module Api
end
end
def list
projects = Project.visible.select do |project|
User.current.allowed_to?(:view_planning_elements, project)
end
assign_planning_elements(projects).order(:id).all
if params[:ids]
ids = params[:ids].split(/,/).map(&:strip).select { |s| s =~ /^\d*$/ }.map(&:to_i).sort
project_ids = projects.map(&:id).sort
options[:conditions] = ["id IN (?) AND project_id IN (?)", ids, project_ids]
end
respond_to do |format|
format.api { render :action => :index }
end
end
def destroy
@planning_element = planning_element_scope.find(params[:id])
@planning_element.destroy

@ -446,8 +446,6 @@ OpenProject::Application.routes.draw do
end
end
get 'planning_elements' => 'planning_elements', :action => 'list'
resources :project_types, :controller => 'project_types' do
member do
get :confirm_destroy

Loading…
Cancel
Save