mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-08 15:55:31 +01:00
Fix: fix custom field query empty element removal (#8056)
This commit is contained in:
parent
33e9990ed5
commit
b2e9f3195a
1 changed files with 7 additions and 2 deletions
|
|
@ -114,16 +114,21 @@ export class CustomFieldQueriesModel {
|
||||||
queryElement: CustomFieldQueryElement,
|
queryElement: CustomFieldQueryElement,
|
||||||
elements: any[]
|
elements: any[]
|
||||||
): CustomFieldQueryElement {
|
): CustomFieldQueryElement {
|
||||||
|
let foundElement
|
||||||
for (let i = 0; i < elements.length; i++) {
|
for (let i = 0; i < elements.length; i++) {
|
||||||
if (elements[i] === queryElement) {
|
if (elements[i] === queryElement) {
|
||||||
return elements.splice(i, 1)[0]
|
foundElement = elements.splice(i, 1)[0]
|
||||||
} else if (elements[i].type === CustomFieldQueryElementType.Expression) {
|
} else if (elements[i].type === CustomFieldQueryElementType.Expression) {
|
||||||
return this.findElement(
|
foundElement = this.findElement(
|
||||||
queryElement,
|
queryElement,
|
||||||
elements[i].value as CustomFieldQueryElement[]
|
elements[i].value as CustomFieldQueryElement[]
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (foundElement) {
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return foundElement
|
||||||
}
|
}
|
||||||
|
|
||||||
public removeElement(queryElement: CustomFieldQueryElement) {
|
public removeElement(queryElement: CustomFieldQueryElement) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue