Commit 18508fd0 authored by Peter Leitzen's avatar Peter Leitzen

Merge branch...

Merge branch '214583-change-mutation-input-to-remove-projects-from-security-dashboard' into 'master'

Change input from projectId to id in RemoveProjectFromSecurityDashboard

See merge request gitlab-org/gitlab!31575
parents 673e08a2 3b2b5aa2
...@@ -8504,7 +8504,7 @@ input RemoveProjectFromSecurityDashboardInput { ...@@ -8504,7 +8504,7 @@ input RemoveProjectFromSecurityDashboardInput {
""" """
ID of the project to remove from the Instance Security Dashboard ID of the project to remove from the Instance Security Dashboard
""" """
projectId: ID! id: ID!
} }
""" """
......
...@@ -24943,7 +24943,7 @@ ...@@ -24943,7 +24943,7 @@
"fields": null, "fields": null,
"inputFields": [ "inputFields": [
{ {
"name": "projectId", "name": "id",
"description": "ID of the project to remove from the Instance Security Dashboard", "description": "ID of the project to remove from the Instance Security Dashboard",
"type": { "type": {
"kind": "NON_NULL", "kind": "NON_NULL",
......
...@@ -7,15 +7,15 @@ module Mutations ...@@ -7,15 +7,15 @@ module Mutations
authorize :read_instance_security_dashboard authorize :read_instance_security_dashboard
argument :project_id, GraphQL::ID_TYPE, argument :id, GraphQL::ID_TYPE,
required: true, required: true,
description: 'ID of the project to remove from the Instance Security Dashboard' description: 'ID of the project to remove from the Instance Security Dashboard'
def resolve(project_id:) def resolve(id:)
dashboard = authorized_find! dashboard = authorized_find!
raise_resource_not_available_error! unless dashboard.feature_available?(:security_dashboard) raise_resource_not_available_error! unless dashboard.feature_available?(:security_dashboard)
result = remove_project(extract_project_id(project_id)) result = remove_project(extract_project_id(id))
{ {
errors: result.zero? ? ['The project does not belong to your dashboard or you don\'t have permission to perform this action'] : [] errors: result.zero? ? ['The project does not belong to your dashboard or you don\'t have permission to perform this action'] : []
......
---
title: Modify GraphQL mutation for removing project from Instance Security Dashboard
to use id instead of projectId
merge_request: 31575
author:
type: changed
...@@ -17,7 +17,7 @@ describe Mutations::InstanceSecurityDashboard::RemoveProject do ...@@ -17,7 +17,7 @@ describe Mutations::InstanceSecurityDashboard::RemoveProject do
already_added_project.add_developer(user) already_added_project.add_developer(user)
end end
subject { mutation.resolve(project_id: project_id) } subject { mutation.resolve(id: project_id) }
context 'when user is not logged_in' do context 'when user is not logged_in' do
let(:current_user) { nil } let(:current_user) { nil }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment