Auto discard change before delete custom response (#946)

This commit is contained in:
LautaroCesso 2020-12-26 18:09:22 -03:00 committed by GitHub
parent 534bf3624a
commit bc9023b8a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 14 deletions

View File

@ -125,11 +125,7 @@ class AdminPanelCustomResponses extends React.Component {
}
getFormProps() {
const {
form,
errors,
formLoading
} = this.state;
const { form, errors, formLoading } = this.state;
return {
values: form,
@ -211,6 +207,8 @@ class AdminPanelCustomResponses extends React.Component {
}
deleteCustomResponse() {
this.updateForm(this.state.selectedIndex)
return API.call({
path: '/ticket/delete-custom-response',
data: {
@ -223,10 +221,7 @@ class AdminPanelCustomResponses extends React.Component {
}
updateForm(index) {
const {
items,
language
} = this.props;
const { items, language } = this.props;
const item = items[index];
let form = _.clone(this.state.form);
@ -251,11 +246,7 @@ class AdminPanelCustomResponses extends React.Component {
}
isEdited() {
const {
form,
formClicked,
originalForm
} = this.state;
const { form, formClicked, originalForm } = this.state;
return (
form.title && formClicked && (