From 08b92dbafd8f90e591cfc9d2fa5d00f4b3f3995e Mon Sep 17 00:00:00 2001 From: Chris Brame Date: Sun, 26 Jun 2022 05:38:38 -0400 Subject: [PATCH] fix(tags): clear button not working on AddTagsModal --- src/client/containers/Modals/AddTagsModal.jsx | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/client/containers/Modals/AddTagsModal.jsx b/src/client/containers/Modals/AddTagsModal.jsx index 8d53c2c70..3aee93ce4 100644 --- a/src/client/containers/Modals/AddTagsModal.jsx +++ b/src/client/containers/Modals/AddTagsModal.jsx @@ -57,6 +57,23 @@ class AddTagsModal extends React.Component { }) } + onClearClicked () { + axios + .put(`/api/v1/tickets/${this.props.ticketId}`, { + tags: [] + }) + .then(() => { + $(this.select) + .val('') + .trigger('chosen:updated') + this.props.socket.emit(TICKETS_UI_TAGS_UPDATE, { ticketId: this.props.ticketId }) + }) + .catch(error => { + Log.error(error) + helpers.UI.showSnackbar(error, true) + }) + } + render () { const mappedTags = this.props.tagsSettings.tags && @@ -99,7 +116,14 @@ class AddTagsModal extends React.Component {
-