Fixed issue #1733: Can't un-link i-doit Objects in a Ticket.
This commit is contained in:
parent
db9d0a0eae
commit
3c1744af0b
2 changed files with 7 additions and 3 deletions
|
@ -22,7 +22,12 @@ class SidebarIdoit extends App.Controller
|
||||||
container: @el.closest('.content')
|
container: @el.closest('.content')
|
||||||
callback: (objectIds, objectSelectorUi) =>
|
callback: (objectIds, objectSelectorUi) =>
|
||||||
if @ticket && @ticket.id
|
if @ticket && @ticket.id
|
||||||
@updateTicket(@ticket.id, objectIds, =>
|
|
||||||
|
# add new objectIds to list of all @objectIds
|
||||||
|
# and transfer the complete list to the backend
|
||||||
|
@objectIds = @objectIds.concat(objectIds)
|
||||||
|
|
||||||
|
@updateTicket(@ticket.id, @objectIds, =>
|
||||||
objectSelectorUi.close()
|
objectSelectorUi.close()
|
||||||
@showObjectsContent(objectIds)
|
@showObjectsContent(objectIds)
|
||||||
)
|
)
|
||||||
|
|
|
@ -40,8 +40,7 @@ class Integration::IdoitController < ApplicationController
|
||||||
ticket = Ticket.find(params[:ticket_id])
|
ticket = Ticket.find(params[:ticket_id])
|
||||||
access!(ticket, 'read')
|
access!(ticket, 'read')
|
||||||
ticket.preferences[:idoit] ||= {}
|
ticket.preferences[:idoit] ||= {}
|
||||||
ticket.preferences[:idoit][:object_ids] ||= []
|
ticket.preferences[:idoit][:object_ids] = Array(params[:object_ids]).uniq
|
||||||
ticket.preferences[:idoit][:object_ids].concat(params[:object_ids])
|
|
||||||
ticket.save!
|
ticket.save!
|
||||||
|
|
||||||
render json: {
|
render json: {
|
||||||
|
|
Loading…
Reference in a new issue