Follow-up 76c0a69403 - Maintenance: Desktop view - Agent-customers can save agent fields on customer tickets
This commit is contained in:
committed by
Dominik Klein
parent
219752db08
commit
2b9f9bc5f2
@@ -5,13 +5,7 @@ module Gql::Types::Input::Ticket
|
||||
description 'Represents the ticket attributes to be used in ticket update.'
|
||||
|
||||
# Arguments optional in update.
|
||||
argument :group_id,
|
||||
GraphQL::Types::ID,
|
||||
required: false,
|
||||
description: 'The group of the ticket.',
|
||||
loads: Gql::Types::GroupType,
|
||||
prepare: only_for_ticket_agents
|
||||
|
||||
argument :group_id, GraphQL::Types::ID, required: false, description: 'The group of the ticket.', loads: Gql::Types::GroupType
|
||||
argument :title, Gql::Types::NonEmptyStringType, required: false, description: 'The title of the ticket.'
|
||||
|
||||
# Arguments specific to update.
|
||||
@@ -22,7 +16,7 @@ module Gql::Types::Input::Ticket
|
||||
loads: Gql::Types::Ticket::SharedDraftZoomType
|
||||
|
||||
def self.agent_only_fields
|
||||
super + %w[shared_draft_id]
|
||||
super + %w[shared_draft_id group_id]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -369,8 +369,13 @@ RSpec.describe Gql::Mutations::Ticket::Update, :aggregate_failures, type: :graph
|
||||
end
|
||||
|
||||
context 'when trying to change the group_id' do
|
||||
let(:other_group) { create(:group) }
|
||||
let(:input_payload) { input_base_payload.tap { |h| h[:groupId] = gql.id(other_group) } }
|
||||
let(:other_group) { create(:group) }
|
||||
let(:input_payload) do
|
||||
input_base_payload
|
||||
.tap { |h| h[:groupId] = gql.id(other_group) }
|
||||
.tap { |h| h.delete(:ownerId) }
|
||||
.tap { |h| h.delete(:customer) }
|
||||
end
|
||||
|
||||
it 'ignores the group_id change and keeps the original group' do
|
||||
gql.execute(query, variables:)
|
||||
|
||||
Reference in New Issue
Block a user