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

remove group xml api

ulfertsbeb8c0c4ef41
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index dd16fd099dc..5c3d92155f6 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -34,47 +34,23 @@ class GroupsController < ApplicationController
before_action :find_group, only: %i[destroy update show create_memberships destroy_membership
edit_membership add_users]
- # GET /groups
- # GET /groups.xml
def index
@groups = Group.order(Arel.sql('lastname ASC'))
-
- respond_to do |format|
- format.html # index.html.erb
- format.xml { render xml: @groups }
- end
end
- # GET /groups/1
- # GET /groups/1.xml
def show
- respond_to do |format|
- format.html do
- @group_users = group_members
- render layout: 'no_menu'
- end
- format.xml { render xml: @group }
- end
+ @group_users = group_members
+ render layout: 'no_menu'
end
- # GET /groups/new
- # GET /groups/new.xml
def new
@group = Group.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.xml { render xml: @group }
- end
end
- # GET /groups/1/edit
def edit
@group = Group.includes(:members, :users).find(params[:id])
end
- # POST /groups
- # POST /groups.xml
def create
service_call = Groups::CreateService
.new(user: current_user)
@@ -82,51 +58,34 @@ class GroupsController < ApplicationController
@group = service_call.result
- respond_to do |format|
- if service_call.success?
- flash[:notice] = I18n.t(:notice_successful_create)
- format.html { redirect_to(groups_path) }
- format.xml { render xml: @group, status: :created, location: @group }
- else
- format.html { render action: :new }
- format.xml { render xml: service_call.errors, status: :unprocessable_entity }
- end
+ if service_call.success?
+ flash[:notice] = I18n.t(:notice_successful_create)
+ redirect_to(groups_path)
+ else
+ render action: :new
end
end
- # PUT /groups/1
- # PUT /groups/1.xml
def update
service_call = Groups::UpdateService
.new(user: current_user, model: @group)
.call(permitted_params.group)
- respond_to do |format|
- if service_call.success?
- flash[:notice] = I18n.t(:notice_successful_update)
- format.html { redirect_to(groups_path) }
- format.xml { head :ok }
- else
- format.html { render action: 'edit' }
- format.xml { render xml: service_call.errors, status: :unprocessable_entity }
- end
+ if service_call.success?
+ flash[:notice] = I18n.t(:notice_successful_update)
+ redirect_to(groups_path)
+ else
+ render action: 'edit'
end
end
- # DELETE /groups/1
- # DELETE /groups/1.xml
def destroy
Groups::DeleteService
.new(user: current_user, model: @group)
.call
- respond_to do |format|
- format.html do
- flash[:info] = I18n.t(:notice_deletion_scheduled)
- redirect_to(action: :index)
- end
- format.xml { head :accepted }
- end
+ flash[:info] = I18n.t(:notice_deletion_scheduled)
+ redirect_to(action: :index)
end
def add_users