Skip to content

Commit

Permalink
fix(data): run change queue was not setting the tags in the right pla…
Browse files Browse the repository at this point in the history
…ce in the annotation files.
  • Loading branch information
geoffroy-noel-ddh committed Aug 14, 2024
1 parent 514deca commit 7f2f2fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/assets/search.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ createApp({
// this.index = await utils.fetchJsonFile(INDEX_PATH)
// fetch with API so we don't need to republish site each time the index is rebuilt.

if (0 && IS_BROWSER_LOCAL) {
if (IS_BROWSER_LOCAL) {
this.index = await utils.fetchJsonFile('index.json')
} else {
let res = await this.afs.readJson(INDEX_PATH)
Expand Down
7 changes: 4 additions & 3 deletions tools/run-change-queue.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class ChangeQueueRunner {

applyChangeToAnnotation(change, annotation) {
if (change.tags) {
let tagsSet = new Set(annotation.tags || [])
let annotationValue = annotation.body[0].value
let tagsSet = new Set(annotationValue.tags || [])
for (let tag of change.tags) {
if (tag.startsWith('-')) {
tagsSet.delete(tag.substring(1))
Expand All @@ -50,9 +51,9 @@ class ChangeQueueRunner {
}
}
if (tagsSet.size) {
annotation.tags = [...tagsSet]
annotationValue.tags = [...tagsSet]
} else {
delete annotation.tags
delete annotationValue.tags
}
}
annotation.modifiedBy = change.creator
Expand Down

0 comments on commit 7f2f2fa

Please sign in to comment.