Skip to content

Commit 08b92db

Browse files
committed
fix(tags): clear button not working on AddTagsModal
1 parent 1e6adc4 commit 08b92db

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

src/client/containers/Modals/AddTagsModal.jsx

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,23 @@ class AddTagsModal extends React.Component {
5757
})
5858
}
5959

60+
onClearClicked () {
61+
axios
62+
.put(`/api/v1/tickets/${this.props.ticketId}`, {
63+
tags: []
64+
})
65+
.then(() => {
66+
$(this.select)
67+
.val('')
68+
.trigger('chosen:updated')
69+
this.props.socket.emit(TICKETS_UI_TAGS_UPDATE, { ticketId: this.props.ticketId })
70+
})
71+
.catch(error => {
72+
Log.error(error)
73+
helpers.UI.showSnackbar(error, true)
74+
})
75+
}
76+
6077
render () {
6178
const mappedTags =
6279
this.props.tagsSettings.tags &&
@@ -99,7 +116,14 @@ class AddTagsModal extends React.Component {
99116
</div>
100117

101118
<div className='left' style={{ marginTop: 15 }}>
102-
<Button type={'button'} text={'Clear'} small={true} flat={true} style={'danger'} />
119+
<Button
120+
type={'button'}
121+
text={'Clear'}
122+
small={true}
123+
flat={true}
124+
style={'danger'}
125+
onClick={e => this.onClearClicked(e)}
126+
/>
103127
</div>
104128
<div className='right' style={{ marginTop: 15 }}>
105129
<Button

0 commit comments

Comments
 (0)