File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -287,27 +287,16 @@ class ImportCSVDiscussionsAction implements IContributedMenuSource {
287287 } ) ;
288288 }
289289
290- async postComment ( url : string , accessToken : string , body : string ) : Promise < string > {
291- return new Promise ( async ( resolve , reject ) => {
292- let response : Response = await this . _fetch ( url , {
293- method : 'POST' ,
294- headers : {
295- 'Authorization' : `Bearer ${ accessToken } ` ,
296- 'Content-Type' : 'application/json' ,
297- } ,
298- body : body
299- } ) . then ( async ( response : Response ) => {
300- if ( response . status >= 200 && response . status < 300 ) {
301- let json : string = await response . json ( ) ;
302- resolve ( json ) ;
303- }
304- else {
305- reject ( `Unsuccessful response with status '${ response . status } '` ) ;
306- }
307- } ) . catch ( ( error : Error ) => {
308- reject ( error ) ;
309- } ) ;
290+ async postComment ( url : string , accessToken : string , body : string ) : Promise < any > {
291+ let response : Response = await this . _fetch ( url , {
292+ method : 'POST' ,
293+ headers : {
294+ 'Authorization' : `Bearer ${ accessToken } ` ,
295+ 'Content-Type' : 'application/json' ,
296+ } ,
297+ body : body
310298 } ) ;
299+ return await response . json ( ) ;
311300 } ;
312301
313302 public execute ( actionContext : any ) {
You can’t perform that action at this time.
0 commit comments