diff --git a/src/DragonFly.Client/Modules/ContentModule.cs b/src/DragonFly.Client/Modules/ContentModule.cs index 212c21ac..21986d2f 100644 --- a/src/DragonFly.Client/Modules/ContentModule.cs +++ b/src/DragonFly.Client/Modules/ContentModule.cs @@ -22,7 +22,7 @@ public class ContentModule : ClientModule public override void Init(IDragonFlyApi api) { api.MainMenu().Add("Schema", "fa-solid fa-layer-group", "schema"); - api.MainMenu().Add("Structure", "fa-solid fa-folder-tree", "structure"); + //api.MainMenu().Add("Structure", "fa-solid fa-folder-tree", "structure"); api.MainMenu().Add("Content", "fa-solid fa-list", "content"); api.RegisterField(); diff --git a/src/DragonFly.MongoDB/Storages/MongoStorage.Assets.cs b/src/DragonFly.MongoDB/Storages/MongoStorage.Assets.cs index 37625929..9a700d68 100644 --- a/src/DragonFly.MongoDB/Storages/MongoStorage.Assets.cs +++ b/src/DragonFly.MongoDB/Storages/MongoStorage.Assets.cs @@ -124,10 +124,18 @@ public async Task> QueryAsync(AssetQuery assetQuery) query = query.Where(x => x.Name!.Contains(assetQuery.Pattern) || x.Slug!.Contains(assetQuery.Pattern)); } - IList result = await query - .OrderByDescending(x => x.Name) - .Take(assetQuery.Take) - .ToListAsync(); + query = query.Take(assetQuery.Take); + + if (assetQuery.Folder == null) + { + query = query.OrderByDescending(x => x.CreatedAt); + } + else + { + query = query.OrderBy(x => x.Name); + } + + IList result = await query.ToListAsync(); QueryResult queryResult = new QueryResult(); queryResult.Items = result