Merge pull request #823 from omnivore-app/fix/delete-label

Fix a script error by deleting both labels in pages and highlights
This commit is contained in:
Hongbo Wu
2022-06-21 09:31:27 +08:00
committed by GitHub

View File

@ -104,7 +104,7 @@ export const deleteLabel = async (
index: INDEX_ALIAS,
body: {
script: {
source: `if (ctx._source.highlights != null) {
source: `if (ctx._source.highlights != null && ctx._source.highlights[0].labels != null) {
ctx._source.highlights[0].labels.removeIf(label -> label.name == params.label)
}
if (ctx._source.labels != null) {