Fix: Tag Interface Delete Button #104256
@ -2,12 +2,6 @@
|
||||
<div class="col col-tags-list">
|
||||
<h2 class="column-title">Available Tags</h2>
|
||||
|
||||
<div class="action-buttons btn-bar-group">
|
||||
<div class="btn-bar">
|
||||
<button @click="deleteTag" :disabled="!selectedTag">Delete Tag</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="action-buttons btn-bar">
|
||||
<form @submit="createTag">
|
||||
<div class="create-tag-container">
|
||||
@ -251,16 +245,16 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
deleteTag() {
|
||||
if (!this.selectedTag) {
|
||||
deleteTag(tag) {
|
||||
dr.sybren marked this conversation as resolved
Outdated
|
||||
if (!tag) {
|
||||
return;
|
||||
}
|
||||
|
||||
const api = new WorkerMgtApi(getAPIClient());
|
||||
api
|
||||
.deleteWorkerTag(this.selectedTag.id)
|
||||
.deleteWorkerTag(tag.id)
|
||||
.then(() => {
|
||||
dr.sybren marked this conversation as resolved
Outdated
Sybren A. Stüvel
commented
This can be removed. The SocketIO handling will already remove the tag, no matter who did the deletion. This can be removed. The SocketIO handling will already remove the tag, no matter who did the deletion.
|
||||
this.selectedTag = null;
|
||||
this.tags = this.tags.filter((t) => t.id !== tag.id);
|
||||
this.tabulator.setData(this.tags);
|
||||
})
|
||||
.catch((error) => {
|
||||
|
Loading…
Reference in New Issue
Block a user
This shouldn't happen anyway, so you can just remove the entire conditional return here. Better to raise an error that you can see & debug (because of the
tag.id
access failing) than to silently ignore mistakes.