refactor
This commit is contained in:
@@ -121,11 +121,13 @@ class RestService {
|
|||||||
private async request<T>(method: Method, url: string, data?: any, headers?: any): Promise<T> {
|
private async request<T>(method: Method, url: string, data?: any, headers?: any): Promise<T> {
|
||||||
try {
|
try {
|
||||||
const response = await this.api.request<T>({
|
const response = await this.api.request<T>({
|
||||||
method,
|
method,
|
||||||
url,
|
url,
|
||||||
data,
|
data,
|
||||||
headers,
|
headers,
|
||||||
});
|
validateStatus: (status) => status >= 200 && status < 500,
|
||||||
|
}
|
||||||
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error during request:', error);
|
console.error('Error during request:', error);
|
||||||
|
|||||||
Reference in New Issue
Block a user