Fix checklists in read-only mode [SCI-9488]

This commit is contained in:
Martin Artnik 2023-10-06 13:50:23 +02:00
parent 5265312125
commit 7bdef42523

View file

@ -25,7 +25,9 @@ class ChecklistSerializer < ActiveModel::Serializer
end
def urls
return {} if object.destroyed? || !can_manage_step?(scope[:user] || @instance_options[:user], object.step)
if object.destroyed? || !can_manage_step?(scope[:user] || @instance_options[:user], object.step)
return { checklist_items_url: step_checklist_checklist_items_path(object.step, object) }
end
{
checklist_items_url: step_checklist_checklist_items_path(object.step, object),