Skip to content

Commit 247f37a

Browse files
authored
fix: ensure batch url resources start with / (#2740)
1 parent a724b05 commit 247f37a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

packages/mgt-element/src/utils/BatchRequest.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,7 @@ export class BatchRequest {
5555
public id: string;
5656

5757
constructor(index: number, id: string, resource: string, method: string) {
58-
if (resource.startsWith('/')) {
59-
resource = '/' + resource;
60-
}
61-
this.resource = resource;
58+
this.resource = resource.startsWith('/') ? resource : `/${resource}`;
6259
this.method = method;
6360
this.index = index;
6461
this.id = id;

0 commit comments

Comments
 (0)