Skip to content

Commit

Permalink
fix(tags): clear button not working on AddTagsModal
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Jun 26, 2022
1 parent 1e6adc4 commit 08b92db
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/client/containers/Modals/AddTagsModal.jsx
Expand Up @@ -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 &&
Expand Down Expand Up @@ -99,7 +116,14 @@ class AddTagsModal extends React.Component {
</div>

<div className='left' style={{ marginTop: 15 }}>
<Button type={'button'} text={'Clear'} small={true} flat={true} style={'danger'} />
<Button
type={'button'}
text={'Clear'}
small={true}
flat={true}
style={'danger'}
onClick={e => this.onClearClicked(e)}
/>
</div>
<div className='right' style={{ marginTop: 15 }}>
<Button
Expand Down

0 comments on commit 08b92db

Please sign in to comment.