Skip to content

Commit 28a1047

Browse files
committed
Update request.ts
1 parent 74e9c60 commit 28a1047

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/structures/request.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export default async <T>(
77
token: string,
88
method: Method,
99
options: AxiosRequestConfig
10-
): Promise<ReqRet<T>> => {
11-
return await axios
10+
): Promise<ReqRet<T>> =>
11+
await axios
1212
.request<T>({
1313
url,
1414
method,
@@ -19,13 +19,10 @@ export default async <T>(
1919
},
2020
...options,
2121
})
22-
.then((response) => {
23-
return Promise.resolve({
22+
.then((response) =>
23+
Promise.resolve({
2424
data: response.data,
2525
status: st(response.status),
26-
});
27-
})
28-
.catch((error) => {
29-
return Promise.reject(error);
30-
});
31-
};
26+
})
27+
)
28+
.catch((error) => Promise.reject(error));

0 commit comments

Comments
 (0)