Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegoO committed Jun 13, 2024
1 parent 76df47e commit abc1b5e
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions src/VirtoCommerce.Platform.Web/Controllers/Api/AppsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,21 @@ public AppsController(ILocalModuleCatalog localModuleCatalog)
[HttpGet]
public IEnumerable<AppDescriptor> GetApps()
{
var apps = new List<AppDescriptor>
{
// Add Commerce Manager by Default
new AppDescriptor
{
Id = "platform",
Title = "Commerce Manager",
Description = "Virto Commerce Platform",
RelativeUrl = "/",
IconUrl = "/images/platform_app.svg"
}
};

var applicationList = _localModuleCatalog.Modules.OfType<ManifestModuleInfo>()
var apps = _localModuleCatalog.Modules.OfType<ManifestModuleInfo>()
.SelectMany(x => x.Apps)
.OrderBy(x => x.Title);
.Select(x => new AppDescriptor(x))
.OrderBy(x => x.Title)
.ToList();

foreach (var moduleAppInfo in applicationList)
{
apps.Add(new AppDescriptor(moduleAppInfo));
}
apps.Insert(0, // Add Commerce Manager by Default
new AppDescriptor
{
Id = "platform",
Title = "Commerce Manager",
Description = "Virto Commerce Platform",
RelativeUrl = "/",
IconUrl = "/images/platform_app.svg"
});

return apps;

Expand Down

0 comments on commit abc1b5e

Please sign in to comment.