mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Update page updatedAt when updating highlights
This commit is contained in:
parent
59efc5fea7
commit
00f38d1134
1 changed files with 7 additions and 4 deletions
|
|
@ -25,7 +25,8 @@ export const addHighlightToPage = async (
|
|||
ctx._source.highlights = [params.highlight]
|
||||
} else {
|
||||
ctx._source.highlights.add(params.highlight)
|
||||
}`,
|
||||
}
|
||||
ctx._source.updatedAt = params.highlight.updatedAt`,
|
||||
lang: 'painless',
|
||||
params: {
|
||||
highlight: highlight,
|
||||
|
|
@ -102,11 +103,12 @@ export const deleteHighlight = async (
|
|||
index: INDEX_ALIAS,
|
||||
body: {
|
||||
script: {
|
||||
source:
|
||||
'ctx._source.highlights.removeIf(h -> h.id == params.highlightId)',
|
||||
source: `ctx._source.highlights.removeIf(h -> h.id == params.highlightId);
|
||||
ctx._source.updatedAt = params.updatedAt`,
|
||||
lang: 'painless',
|
||||
params: {
|
||||
highlightId: highlightId,
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
},
|
||||
query: {
|
||||
|
|
@ -257,7 +259,8 @@ export const updateHighlight = async (
|
|||
body: {
|
||||
script: {
|
||||
source: `ctx._source.highlights.removeIf(h -> h.id == params.highlight.id);
|
||||
ctx._source.highlights.add(params.highlight)`,
|
||||
ctx._source.highlights.add(params.highlight);
|
||||
ctx._source.updatedAt = params.highlight.updatedAt`,
|
||||
lang: 'painless',
|
||||
params: {
|
||||
highlight: highlight,
|
||||
|
|
|
|||
Loading…
Reference in a new issue