diff --git a/app/models/site.rb b/app/models/site.rb index 5d3b4565bc2..7fd768416ac 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -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") diff --git a/app/serializers/basic_category_serializer.rb b/app/serializers/basic_category_serializer.rb index a4a110e44d7..06dfa9628eb 100644 --- a/app/serializers/basic_category_serializer.rb +++ b/app/serializers/basic_category_serializer.rb @@ -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 diff --git a/app/serializers/site_category_serializer.rb b/app/serializers/site_category_serializer.rb index 869e9b7868a..120f2986705 100644 --- a/app/serializers/site_category_serializer.rb +++ b/app/serializers/site_category_serializer.rb @@ -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 diff --git a/spec/requests/api/schemas/json/category_create_request.json b/spec/requests/api/schemas/json/category_create_request.json index df67bba74a3..471f34bd518 100644 --- a/spec/requests/api/schemas/json/category_create_request.json +++ b/spec/requests/api/schemas/json/category_create_request.json @@ -39,9 +39,13 @@ }, "search_priority": { "type": "integer" + }, + "form_template_ids": { + "type": "array", + "items": [] } }, "required": [ "name" ] -} +} \ No newline at end of file diff --git a/spec/requests/api/schemas/json/category_create_response.json b/spec/requests/api/schemas/json/category_create_response.json index e13c1642f6a..95b119111e9 100644 --- a/spec/requests/api/schemas/json/category_create_response.json +++ b/spec/requests/api/schemas/json/category_create_response.json @@ -74,6 +74,10 @@ "null" ] }, + "form_template_ids": { + "type": "array", + "items": [] + }, "has_children": { "type": [ "string", diff --git a/spec/requests/api/schemas/json/category_update_response.json b/spec/requests/api/schemas/json/category_update_response.json index 402828ec080..2570b4192c2 100644 --- a/spec/requests/api/schemas/json/category_update_response.json +++ b/spec/requests/api/schemas/json/category_update_response.json @@ -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", diff --git a/spec/requests/api/schemas/json/site_response.json b/spec/requests/api/schemas/json/site_response.json index 78f03880efe..8223bcf80bc 100644 --- a/spec/requests/api/schemas/json/site_response.json +++ b/spec/requests/api/schemas/json/site_response.json @@ -678,6 +678,10 @@ }, "parent_category_id": { "type": "integer" + }, + "form_template_ids": { + "type": "array", + "items": [] } }, "required": [