Fix: Tag Interface Delete Button #104256

Manually merged
Sybren A. Stüvel merged 39 commits from Evelinealy/flamenco:tag-interface into main 2023-11-02 16:13:14 +01:00
Showing only changes of commit e4527ed7c2 - Show all commits

View File

@ -2,12 +2,6 @@
<div class="col col-tags-list"> <div class="col col-tags-list">
<h2 class="column-title">Available Tags</h2> <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"> <div class="action-buttons btn-bar">
<form @submit="createTag"> <form @submit="createTag">
<div class="create-tag-container"> <div class="create-tag-container">
@ -251,16 +245,16 @@ export default {
}); });
}, },
deleteTag() { deleteTag(tag) {
if (!this.selectedTag) { if (!tag) {
return; return;
} }
const api = new WorkerMgtApi(getAPIClient()); const api = new WorkerMgtApi(getAPIClient());
api api
.deleteWorkerTag(this.selectedTag.id) .deleteWorkerTag(tag.id)
.then(() => { .then(() => {
this.selectedTag = null; this.tags = this.tags.filter((t) => t.id !== tag.id);
this.tabulator.setData(this.tags); this.tabulator.setData(this.tags);
}) })
.catch((error) => { .catch((error) => {