fix: 优化查询条件
This commit is contained in:
parent
3b3f379c03
commit
035281ba06
|
@ -29,7 +29,7 @@ const handleTermsToString = (queryTerms: any, terms: Array<TermsType>, parentKey
|
||||||
Object.keys(a).forEach((b) => {
|
Object.keys(a).forEach((b) => {
|
||||||
const key = `${parentKey}[${aIndex}].${b}`
|
const key = `${parentKey}[${aIndex}].${b}`
|
||||||
if (b === 'terms') {
|
if (b === 'terms') {
|
||||||
handleTermsToString(queryTerms, a[b], `${key}.`)
|
handleTermsToString(queryTerms, a[b], `${key}`)
|
||||||
} else {
|
} else {
|
||||||
queryTerms[key] = a[b]
|
queryTerms[key] = a[b]
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ export const paramsEncodeQuery = (params?: ParamsType) => {
|
||||||
const { sorts, terms } = params
|
const { sorts, terms } = params
|
||||||
|
|
||||||
if (terms) {
|
if (terms) {
|
||||||
handleTermsToString(queryParams, terms, 'terms.')
|
handleTermsToString(queryParams, terms, 'terms')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sorts) {
|
if (sorts) {
|
||||||
|
|
Loading…
Reference in New Issue