Commit ba96309f authored by Phil Hughes's avatar Phil Hughes

Converted issuable_index to axios

parent dab430f0
import axios from './lib/utils/axios_utils';
import flash from './flash';
import { __ } from './locale';
import IssuableBulkUpdateSidebar from './issuable_bulk_update_sidebar';
import IssuableBulkUpdateActions from './issuable_bulk_update_actions';
......@@ -23,20 +26,19 @@ export default class IssuableIndex {
$('.incoming-email-token-reset').on('click', (e) => {
e.preventDefault();
$.ajax({
type: 'PUT',
url: $('.incoming-email-token-reset').attr('href'),
dataType: 'json',
success(response) {
$('#issuable_email').val(response.new_address).focus();
},
beforeSend() {
$('.incoming-email-token-reset').text('resetting...');
},
complete() {
$('.incoming-email-token-reset').text('resetting...');
axios.put($('.incoming-email-token-reset').attr('href'))
.then(({ data }) => {
$('#issuable_email').val(data.new_address).focus();
$('.incoming-email-token-reset').text('reset it');
},
});
})
.catch(() => {
flash(__('There was an error when reseting email token.'));
$('.incoming-email-token-reset').text('reset it');
});
});
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment