fix: 优化查询条件

This commit is contained in:
XieYongHong 2023-10-10 10:20:15 +08:00
parent 3b3f379c03
commit 035281ba06
1 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ const handleTermsToString = (queryTerms: any, terms: Array<TermsType>, parentKey
Object.keys(a).forEach((b) => {
const key = `${parentKey}[${aIndex}].${b}`
if (b === 'terms') {
handleTermsToString(queryTerms, a[b], `${key}.`)
handleTermsToString(queryTerms, a[b], `${key}`)
} else {
queryTerms[key] = a[b]
}
@ -48,7 +48,7 @@ export const paramsEncodeQuery = (params?: ParamsType) => {
const { sorts, terms } = params
if (terms) {
handleTermsToString(queryParams, terms, 'terms.')
handleTermsToString(queryParams, terms, 'terms')
}
if (sorts) {