acp init
This commit is contained in:
@@ -204,6 +204,23 @@ function postData(url = '/', data = {}) {
|
||||
});
|
||||
}
|
||||
|
||||
function getData(url = '/', data = {}) {
|
||||
// Default options are marked with *
|
||||
return fetch(`/api${url}`, {
|
||||
method: 'GET', // *GET, POST, PUT, DELETE, etc.
|
||||
// mode: 'no-cors', // no-cors, cors, *same-origin
|
||||
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
|
||||
credentials: 'include', // include, same-origin, *omit
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
redirect: 'error', // manual, *follow, error
|
||||
// referrer: ', // no-referrer, *client
|
||||
body: JSON.stringify(data), // body data type must match "Content-Type" header
|
||||
});
|
||||
}
|
||||
|
||||
function errorToast(message) {
|
||||
toast.error({
|
||||
position: 'topRight',
|
||||
|
||||
Reference in New Issue
Block a user