WIP Добавил обновление данных доверенных лиц
This commit is contained in:
@@ -41,8 +41,13 @@ function request(method, url, headers = {}, body, type = "") {
|
||||
headers: {
|
||||
Authorization: `Bearer ${token}`,
|
||||
...headers,
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
},
|
||||
};
|
||||
if (body) {
|
||||
requestOptions.body = JSON.stringify(body);
|
||||
}
|
||||
}
|
||||
if (method === "POST" || method === "PUT") {
|
||||
if (type && type === "formData") {
|
||||
@@ -74,8 +79,8 @@ function get(url, type, headers, attempts = 3) {
|
||||
return handleRequest("GET", url, headers, attempts, null, type);
|
||||
}
|
||||
|
||||
function del(url, headers, attempts = 3) {
|
||||
return handleRequest("DELETE", url, headers, attempts, null);
|
||||
function del(url, body, headers, attempts = 3) {
|
||||
return handleRequest("DELETE", url, headers, attempts, body);
|
||||
}
|
||||
|
||||
function post(url, body, type, headers, attempts = 3) {
|
||||
|
||||
Reference in New Issue
Block a user