File tree Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,11 @@ export default class OneDriveFileSystem implements FileSystem {
62
62
}
63
63
const myHeaders = new Headers ( ) ;
64
64
myHeaders . append ( "Content-Type" , "application/json" ) ;
65
+ if ( parent !== "" ) {
66
+ parent = `:${ parent } :` ;
67
+ }
65
68
return this . request (
66
- `https://graph.microsoft.com/v1.0/me/ drive/special/approot: ${ parent } : /children` ,
69
+ `https://graph.microsoft.com/v1.0/drive/special/approot${ parent } /children` ,
67
70
{
68
71
method : "POST" ,
69
72
headers : myHeaders ,
@@ -116,7 +119,7 @@ export default class OneDriveFileSystem implements FileSystem {
116
119
117
120
delete ( path : string ) : Promise < void > {
118
121
return this . request (
119
- `https://graph.microsoft.com/v1.0/me/ drive/special/approot:${ joinPath (
122
+ `https://graph.microsoft.com/v1.0/drive/special/approot:${ joinPath (
120
123
this . path ,
121
124
path
122
125
) } `,
@@ -136,9 +139,11 @@ export default class OneDriveFileSystem implements FileSystem {
136
139
let { path } = this ;
137
140
if ( path === "/" ) {
138
141
path = "" ;
142
+ } else {
143
+ path = `:${ path } :` ;
139
144
}
140
145
return this . request (
141
- `https://graph.microsoft.com/v1.0/me/ drive/special/approot: ${ path } : /children`
146
+ `https://graph.microsoft.com/v1.0/drive/special/approot${ path } /children`
142
147
) . then ( ( data ) => {
143
148
const list : File [ ] = [ ] ;
144
149
data . value . forEach ( ( val : any ) => {
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ export class OneDriveFileReader implements FileReader {
18
18
19
19
async read ( type ?: "string" | "blob" ) : Promise < string | Blob > {
20
20
const data = await this . fs . request (
21
- `https://graph.microsoft.com/v1.0/me/ drive/special/approot:${ joinPath (
21
+ `https://graph.microsoft.com/v1.0/drive/special/approot:${ joinPath (
22
22
this . file . path ,
23
23
this . file . name
24
24
) } :/content`,
@@ -69,18 +69,18 @@ export class OneDriveFileWriter implements FileWriter {
69
69
myHeaders . append ( "Content-Type" , "application/json" ) ;
70
70
const uploadUrl = await this . fs
71
71
. request (
72
- `https://graph.microsoft.com/v1.0/me/ drive/special/approot:${ this . path } :/createUploadSession` ,
72
+ `https://graph.microsoft.com/v1.0/drive/special/approot:${ this . path } :/createUploadSession` ,
73
73
{
74
74
method : "POST" ,
75
75
headers : myHeaders ,
76
76
body : JSON . stringify ( {
77
77
item : {
78
78
"@microsoft.graph.conflictBehavior" : "replace" ,
79
- description : "description" ,
80
- fileSystemInfo : {
81
- "@odata.type" : "microsoft.graph.fileSystemInfo" ,
82
- } ,
83
- name : this . path . substring ( this . path . lastIndexOf ( "/" ) + 1 ) ,
79
+ // description: "description",
80
+ // fileSystemInfo: {
81
+ // "@odata.type": "microsoft.graph.fileSystemInfo",
82
+ // },
83
+ // name: this.path.substring(this.path.lastIndexOf("/") + 1),
84
84
} ,
85
85
} ) ,
86
86
}
You can’t perform that action at this time.
0 commit comments