mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 19:30:48 +08:00
DEV: Add choices only to relevant wizard fields (#16993)
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class WizardFieldSerializer < ApplicationSerializer
|
||||
|
||||
attributes :id, :type, :required, :value, :label, :placeholder, :description, :extra_description, :show_in_sidebar
|
||||
has_many :choices, serializer: WizardFieldChoiceSerializer, embed: :objects
|
||||
|
||||
@ -76,4 +75,7 @@ class WizardFieldSerializer < ApplicationSerializer
|
||||
object.show_in_sidebar.present?
|
||||
end
|
||||
|
||||
def include_choices?
|
||||
object.type == "dropdown" || object.type == "radio"
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user