fix: api文档描述更正

This commit is contained in:
Qu Xuan
2020-04-15 17:35:08 +08:00
parent 78e24ccd25
commit 345b8f3f9d
3 changed files with 14 additions and 6 deletions
+7 -1
View File
@@ -215,6 +215,9 @@ func applyListItemsGeneralJointFilters(manager IModelManager, q *sqlchemy.SQuery
jfc := filterclause.ParseJointFilterClause(f)
if jfc != nil {
jointModelManager := GetModelManager(jfc.GetJointModelName())
if jointModelManager == nil {
return nil, httperrors.NewResourceNotFoundError("invalid joint resources %s", jfc.GetJointModelName())
}
schFields := searchFields(jointModelManager, userCred)
if schFields.Contains(jfc.GetField()) {
sq := jointModelManager.Query(jfc.RelatedKey)
@@ -300,7 +303,10 @@ func listItemQueryFiltersRaw(manager IModelManager,
}
jointFilter := jsonutils.GetQueryStringArray(query, "joint_filter")
if len(jointFilter) > 0 {
q, _ = applyListItemsGeneralJointFilters(manager, q, userCred, jointFilter, filterAny)
q, err = applyListItemsGeneralJointFilters(manager, q, userCred, jointFilter, filterAny)
if err != nil {
return nil, err
}
}
return q, nil
}