function busy (yes) { $('#draft-busy').css('opacity', yes ? 1 : 0) } function query (route, data, sucfn, erfn) { busy(true) if (!sucfn) sucfn = () => {} if (!erfn) erfn = () => {} window.axios.post(route, data).then(sucfn).catch((error) => { console.error(error.message) erfn(error.response.data) }).then(() => { busy(false) }) } export { busy, query }