Commit 43f1088f authored by Phil Hughes's avatar Phil Hughes

Converted usage_ping.js to use axios

also removed dependancy on jQuery because it is super simple & not required
parent ee1c471b
import axios from '../../../lib/utils/axios_utils';
import { __ } from '../../../locale';
import flash from '../../../flash';
export default function UsagePing() { export default function UsagePing() {
const usageDataUrl = $('.usage-data').data('endpoint'); const el = document.querySelector('.usage-data');
$.ajax({ axios.get(el.dataset.endpoint, {
type: 'GET', responseType: 'text',
url: usageDataUrl, }).then(({ data }) => {
dataType: 'html', el.innerHTML = data;
success(html) { }).catch(() => flash(__('Error fetching usage ping data.')));
$('.usage-data').html(html);
},
});
} }
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