DEV: Move form_template_ids serializer location (#20446)

This commit is contained in:
Keegan George 2023-02-28 09:09:20 -08:00 committed by GitHub
parent 366f5e08d7
commit def4133d59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 24 additions and 7 deletions

View File

@ -78,6 +78,7 @@ class Site
:uploaded_background,
:tags,
:tag_groups,
:form_templates,
category_required_tag_groups: :tag_group,
)
.joins("LEFT JOIN topics t on t.id = categories.topic_id")

View File

@ -19,7 +19,6 @@ class BasicCategorySerializer < ApplicationSerializer
:notification_level,
:can_edit,
:topic_template,
:form_template_ids,
:has_children,
:sort_order,
:sort_ascending,
@ -92,8 +91,4 @@ class BasicCategorySerializer < ApplicationSerializer
def include_custom_fields?
custom_fields.present?
end
def include_form_template_ids?
SiteSetting.experimental_form_templates
end
end

View File

@ -1,7 +1,11 @@
# frozen_string_literal: true
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

View File

@ -39,6 +39,10 @@
},
"search_priority": {
"type": "integer"
},
"form_template_ids": {
"type": "array",
"items": []
}
},
"required": [

View File

@ -74,6 +74,10 @@
"null"
]
},
"form_template_ids": {
"type": "array",
"items": []
},
"has_children": {
"type": [
"string",

View File

@ -77,6 +77,10 @@
"null"
]
},
"form_template_ids": {
"type": "array",
"items": []
},
"has_children": {
"type": [
"string",
@ -273,6 +277,7 @@
"notification_level",
"can_edit",
"topic_template",
"form_template_ids",
"has_children",
"sort_order",
"sort_ascending",

View File

@ -678,6 +678,10 @@
},
"parent_category_id": {
"type": "integer"
},
"form_template_ids": {
"type": "array",
"items": []
}
},
"required": [