diff --git a/DysonNetwork.Drive/Storage/FilePoolController.cs b/DysonNetwork.Drive/Storage/FilePoolController.cs index 2e206b9..4105f4b 100644 --- a/DysonNetwork.Drive/Storage/FilePoolController.cs +++ b/DysonNetwork.Drive/Storage/FilePoolController.cs @@ -19,6 +19,7 @@ public class FilePoolController(AppDatabase db, FileService fs) : ControllerBase var pools = await db.Pools .Where(p => p.PolicyConfig.PublicUsable || p.AccountId == accountId) .Where(p => !p.IsHidden || p.AccountId == accountId) + .OrderBy(p => p.CreatedAt) .ToListAsync(); pools = pools.Select(p => { @@ -29,14 +30,14 @@ public class FilePoolController(AppDatabase db, FileService fs) : ControllerBase return Ok(pools); } - + [Authorize] [HttpDelete("{id:guid}/recycle")] public async Task DeleteFilePoolRecycledFiles(Guid id) { if (HttpContext.Items["CurrentUser"] is not Account currentUser) return Unauthorized(); var accountId = Guid.Parse(currentUser.Id); - + var pool = await fs.GetPoolAsync(id); if (pool is null) return NotFound(); if (!currentUser.IsSuperuser && pool.AccountId != accountId) return Unauthorized(); @@ -44,4 +45,4 @@ public class FilePoolController(AppDatabase db, FileService fs) : ControllerBase var count = await fs.DeletePoolRecycledFilesAsync(id); return Ok(new { Count = count }); } -} \ No newline at end of file +}