Skip to content

Commit d775459

Browse files
committed
Update request.js
1 parent 7162027 commit d775459

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

dist/src/structures/request.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
44
};
55
Object.defineProperty(exports, "__esModule", { value: true });
66
const axios_1 = __importDefault(require("axios"));
7+
const http_status_1 = __importDefault(require("./http_status"));
78
exports.default = async (url, token, method, options) => {
89
return await axios_1.default
910
.request({
1011
url,
1112
method,
1213
headers: {
13-
"content-type": "application/json",
14-
accept: "application/vnd.github.v3+json",
14+
'content-type': 'application/json',
15+
accept: 'application/vnd.github.v3+json',
1516
Authorization: `Bearer ${token}`,
1617
},
1718
...options,
1819
})
1920
.then((response) => {
20-
return Promise.resolve(response.data);
21+
return Promise.resolve({
22+
data: response.data,
23+
status: (0, http_status_1.default)(response.status),
24+
});
2125
})
2226
.catch((error) => {
2327
return Promise.reject(error);

0 commit comments

Comments
 (0)