From 649380f076951311817d7e5e807f24902c7da5c1 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Mon, 22 Nov 2021 07:56:15 +0900 Subject: [PATCH] Enable to delete relation if one of the entities are deleted --- frontend/pages/demo/named-entity-recognition/index.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/pages/demo/named-entity-recognition/index.vue b/frontend/pages/demo/named-entity-recognition/index.vue index 4439b834..60c0477a 100644 --- a/frontend/pages/demo/named-entity-recognition/index.vue +++ b/frontend/pages/demo/named-entity-recognition/index.vue @@ -170,6 +170,11 @@ export default { methods: { deleteEntity(annotationId) { this.currentDoc.annotations = this.currentDoc.annotations.filter(item => item.id !== annotationId) + this.relations.forEach((r) => { + if (r.fromId === annotationId || r.toId === annotationId) { + this.deleteRelation(r.id) + } + }) }, updateEntity(annotationId, labelId) { const index = this.currentDoc.annotations.findIndex(item => item.id === annotationId)