fix(search): correct type_id usage in CI relation filtering #633
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
问题:接口https://cmdb.veops.cn/api/v0.1/ci_relations/search/full?level=2&root_ids=5&has_m2m=1&type_ids=1,2
在获取层级关系时,如果父CITYPE关联的两个子CITYPE的唯一标识字段一致,使用该接口获取数据时,会出现错乱。以type_ids=1,2为例,原意是要获取1,2两个CITYPE的2层关系,但通过该接口会获取到已关联的其他子CITYPE的数据。
修复方式:具体见代码。