File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -4,20 +4,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
44} ;
55Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
66const axios_1 = __importDefault ( require ( "axios" ) ) ;
7+ const http_status_1 = __importDefault ( require ( "./http_status" ) ) ;
78exports . 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 ) ;
You can’t perform that action at this time.
0 commit comments