File tree 2 files changed +10
-13
lines changed
packages/storage-core/src
2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @supabase-cache-helpers/storage-core " : patch
3
+ ---
4
+
5
+ fix: use new .info() for ensureExistence
Original file line number Diff line number Diff line change @@ -23,21 +23,13 @@ export const createUrlFetcher = (
23
23
fileApi : StorageFileApi ,
24
24
path : string ,
25
25
) : Promise < string | undefined > => {
26
- let params : Record < string , string > | undefined ;
26
+ let params : Record < string , string > = { } ;
27
+
27
28
if ( config ?. ensureExistence ) {
28
- const pathElements = path . split ( '/' ) ;
29
- const fileName = pathElements . pop ( ) ;
30
- const { data : files } = await fileApi . list ( pathElements . join ( '/' ) , {
31
- limit : 1 ,
32
- search : fileName ,
33
- } ) ;
34
- if ( ! files || files . length === 0 ) return ;
35
- params = {
36
- updated_at : files [ 0 ] . updated_at ,
37
- } ;
38
- } else {
29
+ const { data : fileInfo } = await fileApi . info ( path ) ;
30
+ if ( ! fileInfo ) return ;
39
31
params = {
40
- updated_at : Date . now ( ) . toString ( ) ,
32
+ updated_at : fileInfo . updatedAt ,
41
33
} ;
42
34
}
43
35
You can’t perform that action at this time.
0 commit comments