File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ export default class StorageFileApi {
68
68
fileOptions ?: FileOptions
69
69
) : Promise <
70
70
| {
71
- data : { path : string }
71
+ data : { id : string , path : string , fullPath : string }
72
72
error : null
73
73
}
74
74
| {
@@ -106,13 +106,15 @@ export default class StorageFileApi {
106
106
...( options ?. duplex ? { duplex : options . duplex } : { } ) ,
107
107
} )
108
108
109
+ const data = await res . json ( )
110
+
109
111
if ( res . ok ) {
110
112
return {
111
- data : { path : cleanPath } ,
113
+ data : { path : cleanPath , id : data . Id , fullPath : data . Key } ,
112
114
error : null ,
113
115
}
114
116
} else {
115
- const error = await res . json ( )
117
+ const error = data
116
118
return { data : null , error }
117
119
}
118
120
} catch ( error ) {
@@ -192,13 +194,15 @@ export default class StorageFileApi {
192
194
headers,
193
195
} )
194
196
197
+ const data = await res . json ( )
198
+
195
199
if ( res . ok ) {
196
200
return {
197
- data : { path : cleanPath } ,
201
+ data : { path : cleanPath , fullPath : data . Key } ,
198
202
error : null ,
199
203
}
200
204
} else {
201
- const error = await res . json ( )
205
+ const error = data
202
206
return { data : null , error }
203
207
}
204
208
} catch ( error ) {
You can’t perform that action at this time.
0 commit comments