pref: bucket sort by name. rustfs/s3-rustfs#282

This commit is contained in:
cxymds
2025-03-31 16:32:43 +08:00
parent 279d47ab35
commit e4c5d17e70
+4 -1
View File
@@ -127,7 +127,10 @@ const { data, refresh } = await useAsyncData(
'buckets',
async () => {
const response = await listBuckets();
return response.Buckets || [];
// sort by creation date
// return response.Buckets?.sort((a:any, b:any) => {return new Date(b.CreationDate).getTime() - new Date(a.CreationDate).getTime() }) || [];
// sort by name
return response.Buckets?.sort((a:any, b:any) => {return a.Name.localeCompare(b.Name) }) || [];
},
{ default: () => [] }
);