Добавил employee на расписание и стили
This commit is contained in:
@@ -5,6 +5,11 @@ function prepareUrl(url) {
|
||||
return `https://astra-dev.dopcore.com/api/${url}`;
|
||||
}
|
||||
|
||||
function prepareUrlApi(url) {
|
||||
if (url.startsWith("http")) return url;
|
||||
return `https://astra-dev.dopcore.com/${url}`;
|
||||
}
|
||||
|
||||
function handleRequest(method, url, headers, attempts, body, type) {
|
||||
return new Promise((resolve, reject) => {
|
||||
(function internalRequest() {
|
||||
@@ -67,12 +72,13 @@ function request(method, url, headers = {}, body, type = "") {
|
||||
body: JSON.stringify(body),
|
||||
};
|
||||
}
|
||||
|
||||
return fetch(prepareUrl(url), requestOptions);
|
||||
if (type === "api") {
|
||||
return fetch(prepareUrlApi(url), requestOptions);
|
||||
} else return fetch(prepareUrl(url), requestOptions);
|
||||
}
|
||||
|
||||
function get(url, headers, attempts = 3) {
|
||||
return handleRequest("GET", url, headers, attempts, null);
|
||||
function get(url, type, headers, attempts = 3) {
|
||||
return handleRequest("GET", url, headers, attempts, null, type);
|
||||
}
|
||||
|
||||
function del(url, headers, attempts = 3) {
|
||||
|
||||
Reference in New Issue
Block a user