DEV: Move `form_template_ids` serializer location (#20446)
This commit is contained in:
parent
366f5e08d7
commit
def4133d59
|
@ -78,6 +78,7 @@ class Site
|
||||||
:uploaded_background,
|
:uploaded_background,
|
||||||
:tags,
|
:tags,
|
||||||
:tag_groups,
|
:tag_groups,
|
||||||
|
:form_templates,
|
||||||
category_required_tag_groups: :tag_group,
|
category_required_tag_groups: :tag_group,
|
||||||
)
|
)
|
||||||
.joins("LEFT JOIN topics t on t.id = categories.topic_id")
|
.joins("LEFT JOIN topics t on t.id = categories.topic_id")
|
||||||
|
|
|
@ -19,7 +19,6 @@ class BasicCategorySerializer < ApplicationSerializer
|
||||||
:notification_level,
|
:notification_level,
|
||||||
:can_edit,
|
:can_edit,
|
||||||
:topic_template,
|
:topic_template,
|
||||||
:form_template_ids,
|
|
||||||
:has_children,
|
:has_children,
|
||||||
:sort_order,
|
:sort_order,
|
||||||
:sort_ascending,
|
:sort_ascending,
|
||||||
|
@ -92,8 +91,4 @@ class BasicCategorySerializer < ApplicationSerializer
|
||||||
def include_custom_fields?
|
def include_custom_fields?
|
||||||
custom_fields.present?
|
custom_fields.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def include_form_template_ids?
|
|
||||||
SiteSetting.experimental_form_templates
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class SiteCategorySerializer < BasicCategorySerializer
|
class SiteCategorySerializer < BasicCategorySerializer
|
||||||
attributes :allowed_tags, :allowed_tag_groups, :allow_global_tags, :read_only_banner
|
attributes :allowed_tags,
|
||||||
|
:allowed_tag_groups,
|
||||||
|
:allow_global_tags,
|
||||||
|
:read_only_banner,
|
||||||
|
:form_template_ids
|
||||||
|
|
||||||
has_many :category_required_tag_groups, key: :required_tag_groups, embed: :objects
|
has_many :category_required_tag_groups, key: :required_tag_groups, embed: :objects
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,10 @@
|
||||||
},
|
},
|
||||||
"search_priority": {
|
"search_priority": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"form_template_ids": {
|
||||||
|
"type": "array",
|
||||||
|
"items": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
|
|
@ -74,6 +74,10 @@
|
||||||
"null"
|
"null"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"form_template_ids": {
|
||||||
|
"type": "array",
|
||||||
|
"items": []
|
||||||
|
},
|
||||||
"has_children": {
|
"has_children": {
|
||||||
"type": [
|
"type": [
|
||||||
"string",
|
"string",
|
||||||
|
|
|
@ -77,6 +77,10 @@
|
||||||
"null"
|
"null"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"form_template_ids": {
|
||||||
|
"type": "array",
|
||||||
|
"items": []
|
||||||
|
},
|
||||||
"has_children": {
|
"has_children": {
|
||||||
"type": [
|
"type": [
|
||||||
"string",
|
"string",
|
||||||
|
@ -273,6 +277,7 @@
|
||||||
"notification_level",
|
"notification_level",
|
||||||
"can_edit",
|
"can_edit",
|
||||||
"topic_template",
|
"topic_template",
|
||||||
|
"form_template_ids",
|
||||||
"has_children",
|
"has_children",
|
||||||
"sort_order",
|
"sort_order",
|
||||||
"sort_ascending",
|
"sort_ascending",
|
||||||
|
|
|
@ -678,6 +678,10 @@
|
||||||
},
|
},
|
||||||
"parent_category_id": {
|
"parent_category_id": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"form_template_ids": {
|
||||||
|
"type": "array",
|
||||||
|
"items": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
|
Loading…
Reference in New Issue