mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 16:40:01 +08:00
FIX: ensure required_tag_group_name is null if no value present (#14796)
* FIX: ensure required_tag_group_name is null if no value present If the array was present but empty `required_tag_group_name` would be set to undefined, which would then be removed from the payload of the remote request. Addming the length check ensures the value is set to null, which is sent as an empty value (which the backend sees, and can remove it and persist the change on the Category object).
This commit is contained in:
parent
9b30103628
commit
6360d3d4e7
|
@ -221,9 +221,10 @@ const Category = RestModel.extend({
|
|||
? this.allowed_tag_groups
|
||||
: null,
|
||||
allow_global_tags: this.allow_global_tags,
|
||||
required_tag_group_name: this.required_tag_groups
|
||||
? this.required_tag_groups[0]
|
||||
: null,
|
||||
required_tag_group_name:
|
||||
this.required_tag_groups && this.required_tag_groups.length > 0
|
||||
? this.required_tag_groups[0]
|
||||
: null,
|
||||
min_tags_from_required_group: this.min_tags_from_required_group,
|
||||
sort_order: this.sort_order,
|
||||
sort_ascending: this.sort_ascending,
|
||||
|
|
Loading…
Reference in New Issue
Block a user