diff --git a/webui/src/components/display/blobs/ImageViewer.svelte b/webui/src/components/display/blobs/ImageViewer.svelte index 4f75369..8d04967 100644 --- a/webui/src/components/display/blobs/ImageViewer.svelte +++ b/webui/src/components/display/blobs/ImageViewer.svelte @@ -144,15 +144,25 @@ anno.on("updateAnnotation", async (annotation) => { const annotationObject = await fetchEntity(annotation.id); await Promise.all( - annotationObject.attr["LBL"].map(async (e) => { - fetch(`api/obj/${e.address}`, { method: "DELETE" }); - }) + annotationObject.attr["LBL"] + .concat(annotationObject.attr["W3C_FRAGMENT_SELECTOR"]) + .map(async (e) => { + fetch(`api/obj/${e.address}`, { method: "DELETE" }); + }) ); await fetch("api/obj", { method: "PUT", headers: { "Content-Type": "application/json" }, - body: JSON.stringify( - annotation.body.map((body) => { + body: JSON.stringify([ + { + entity: annotation.id, + attribute: "W3C_FRAGMENT_SELECTOR", + value: { + t: "String", + c: annotation.target.selector.value, + }, + }, + ...annotation.body.map((body) => { return { entity: annotation.id, attribute: "LBL", @@ -161,8 +171,8 @@ c: body.value, }, }; - }) - ), + }), + ]), }); }); anno.on("deleteAnnotation", async (annotation) => {