File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ class BatchRequest {
6161 public method : string ;
6262
6363 public constructor ( resource : string , method : string ) {
64+ if ( resource . charAt ( 0 ) !== '/' ) {
65+ resource = '/' + resource ;
66+ }
6467 this . resource = resource ;
6568 this . method = method ;
6669 }
@@ -71,6 +74,10 @@ export class Batch {
7174 private scopes : string [ ] = [ ] ;
7275 private client : Client ;
7376
77+ // this doesn't really mater what it is as long as it's a root base url
78+ // otherwise a Request assumes the current path and that could change the relative path
79+ private static baseUrl = 'https://graph.microsoft.com' ;
80+
7481 constructor ( client : Client ) {
7582 this . client = client ;
7683 }
@@ -96,7 +103,7 @@ export class Batch {
96103 for ( let request of this . requests ) {
97104 batchRequestContent . addRequest ( {
98105 id : request [ 0 ] ,
99- request : new Request ( request [ 1 ] . resource , {
106+ request : new Request ( Batch . baseUrl + request [ 1 ] . resource , {
100107 method : request [ 1 ] . method
101108 } )
102109 } ) ;
You can’t perform that action at this time.
0 commit comments