Skip to content

Commit

Permalink
remove frontend initiated entity deletes
Browse files Browse the repository at this point in the history
Deletes of resources related to vocabulary are now handled in the
backend.
  • Loading branch information
MikiDi committed Oct 3, 2023
1 parent 7cdc117 commit 53ba0ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 1 addition & 8 deletions app/controllers/vocabularies/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ export default class VocabulariesIndexController extends Controller {

@action
async deleteVocab(vocabulary) {
const datasets = await vocabulary.sourceDatasets;
const promises = datasets.map((d) => d.destroyRecord());
const shape = await vocabulary.mappingShape;
await Promise.all([
...promises,
shape?.destroyRecord(),
vocabulary.destroyRecord(),
]);
vocabulary.destroyRecord();
}
}
4 changes: 3 additions & 1 deletion app/templates/vocabularies/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
>
<:message>
<p>Are you sure you want to delete vocabulary
<strong>{{vocab.name}}</strong>?</p>
<strong>{{vocab.name}}</strong>?<br><br>
<i>Note that deleting large vocabularies may take a long time. Make sure to refresh the page manually.</i>
</p>
</:message>
<:buttonContent>
<BsIcon @name='trash-fill' />
Expand Down

0 comments on commit 53ba0ff

Please sign in to comment.