Converted usage_ping.js to use axios
also removed dependancy on jQuery because it is super simple & not required
This commit is contained in:
parent
ee1c471bad
commit
43f1088f5b
1 changed files with 11 additions and 10 deletions
|
@ -1,12 +1,13 @@
|
||||||
export default function UsagePing() {
|
import axios from '../../../lib/utils/axios_utils';
|
||||||
const usageDataUrl = $('.usage-data').data('endpoint');
|
import { __ } from '../../../locale';
|
||||||
|
import flash from '../../../flash';
|
||||||
|
|
||||||
$.ajax({
|
export default function UsagePing() {
|
||||||
type: 'GET',
|
const el = document.querySelector('.usage-data');
|
||||||
url: usageDataUrl,
|
|
||||||
dataType: 'html',
|
axios.get(el.dataset.endpoint, {
|
||||||
success(html) {
|
responseType: 'text',
|
||||||
$('.usage-data').html(html);
|
}).then(({ data }) => {
|
||||||
},
|
el.innerHTML = data;
|
||||||
});
|
}).catch(() => flash(__('Error fetching usage ping data.')));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue