mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Fix not setting labels to the correct highlight in a page
This commit is contained in:
parent
434aaf98b0
commit
264ebef46e
2 changed files with 3 additions and 2 deletions
|
|
@ -70,7 +70,7 @@ export const getHighlightById = async (
|
|||
nested: {
|
||||
path: 'highlights',
|
||||
query: {
|
||||
match: {
|
||||
term: {
|
||||
'highlights.id': id,
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -260,10 +260,11 @@ export const setLabelsForHighlight = async (
|
|||
index: INDEX_ALIAS,
|
||||
body: {
|
||||
script: {
|
||||
source: `ctx._source.highlights[0].labels = params.labels;
|
||||
source: `ctx._source.highlights.stream().filter(h -> params.highlightId.equals(h.id)).findAny().orElse(null).labels = params.labels;
|
||||
ctx._source.updatedAt = params.updatedAt`,
|
||||
lang: 'painless',
|
||||
params: {
|
||||
highlightId,
|
||||
labels: labels,
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue