Skip to content

Commit

Permalink
Added check for manifest edit
Browse files Browse the repository at this point in the history
  • Loading branch information
TessavWalstijn committed Nov 4, 2023
1 parent 0fbe3e7 commit a6ad628
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions src/components/DataEditor/DataEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,30 @@ function saveAnnotations() {
manifestStore.getItems.forEach((item: any, index: number) => {
console.log(item)
manifestStore.manifest.items[0].annotations[0].items.push({
id: 'annotation' + index,
type: 'Annotation',
motivation: 'commenting',
body: {
type: 'TextualBody',
language: 'nl',
format: 'text/plain',
value: item.name_nl,
},
target: target + item.coords,
})
if (
manifestStore.manifest &&
manifestStore.manifest.items &&
manifestStore.manifest.items[0] &&
manifestStore.manifest.items[0].annotations &&
manifestStore.manifest.items[0].annotations[0] &&
manifestStore.manifest.items[0].annotations[0].items
) {
manifestStore.manifest.items[0].annotations[0].items.push({
id: 'annotation' + index,
type: 'Annotation',
motivation: 'commenting',
body: {
type: 'TextualBody',
language: 'nl',
format: 'text/plain',
value: item.name_nl,
},
target: target + item.coords,
})
} else {
console.warn('Something went wrong with the manifest')
}
//console.log(item);
//console.log(index);
})
Expand Down

0 comments on commit a6ad628

Please sign in to comment.