Fix: fix custom field query empty element removal (#8056)

This commit is contained in:
shamoon 2024-10-27 06:53:59 -07:00 committed by GitHub
parent 33e9990ed5
commit b2e9f3195a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -114,16 +114,21 @@ export class CustomFieldQueriesModel {
queryElement: CustomFieldQueryElement,
elements: any[]
): CustomFieldQueryElement {
let foundElement
for (let i = 0; i < elements.length; i++) {
if (elements[i] === queryElement) {
return elements.splice(i, 1)[0]
foundElement = elements.splice(i, 1)[0]
} else if (elements[i].type === CustomFieldQueryElementType.Expression) {
return this.findElement(
foundElement = this.findElement(
queryElement,
elements[i].value as CustomFieldQueryElement[]
)
}
if (foundElement) {
break
}
}
return foundElement
}
public removeElement(queryElement: CustomFieldQueryElement) {