Skip to content

Commit

Permalink
feat: return homepage for empty slug (#637)
Browse files Browse the repository at this point in the history
  • Loading branch information
basilkot authored Mar 16, 2023
1 parent ee0a7b5 commit 21fc00c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using VirtoCommerce.Storefront.Infrastructure;
using VirtoCommerce.Storefront.Model;
using VirtoCommerce.Storefront.Model.Common;
using VirtoCommerce.Storefront.Model.StaticContent;

namespace VirtoCommerce.Storefront.Controllers.Api
{
Expand Down Expand Up @@ -77,7 +76,7 @@ public async Task<SlugInfoResult> GetInfoBySlugAsync(string slug, [FromQuery] st

if (result.EntityInfo == null)
{
var pageUrl = $"/{slug}";
var pageUrl = slug == "home" ? "/" : $"/{slug}";
try
{
var pages = WorkContext.Pages.Where(p =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace VirtoCommerce.Storefront.Controllers.Api
public class ApiThemeController : StorefrontControllerBase
{
private readonly ILiquidThemeEngine _liquidThemeEngine;
public ApiThemeController(IWorkContextAccessor workContextAccessor, IStorefrontUrlBuilder urlBuilder, ILiquidThemeEngine liquidThemeEngine)
public ApiThemeController(IWorkContextAccessor workContextAccessor, IStorefrontUrlBuilder urlBuilder, ILiquidThemeEngine liquidThemeEngine)
: base(workContextAccessor, urlBuilder)
{
_liquidThemeEngine = liquidThemeEngine;
Expand Down

0 comments on commit 21fc00c

Please sign in to comment.