Skip to content

Commit 888a6a8

Browse files
Minor fix (#579)
* Refactor 404 error handling in CommonController * Update ContactController
1 parent 76d73ae commit 888a6a8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Web/Grand.Web/Controllers/CommonController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public virtual async Task<IActionResult> SetLanguage(
152152
{
153153
var language = await _languageService.GetLanguageByCode(langCode);
154154
if (language == null)
155-
return InvokeHttp404();
155+
return NotFound();
156156

157157
if (!language.Published)
158158
language = _contextAccessor.WorkContext.WorkingLanguage;

src/Web/Grand.Web/Controllers/ContactController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using Grand.Web.Events;
1616
using Grand.Web.Models.Contact;
1717
using MediatR;
18+
using Microsoft.AspNetCore.Http;
1819
using Microsoft.AspNetCore.Mvc;
1920

2021
namespace Grand.Web.Controllers;
@@ -39,7 +40,7 @@ public ContactController(
3940
//available even when a store is closed
4041
[ClosedStore(true)]
4142
[HttpGet]
42-
public virtual async Task<ActionResult<ContactUsModel>> Index(
43+
public virtual async Task<IActionResult> Index(
4344
[FromServices] StoreInformationSettings storeInformationSettings,
4445
[FromServices] IPageService pageService)
4546
{
@@ -62,7 +63,7 @@ public virtual async Task<ActionResult<ContactUsModel>> Index(
6263
[AutoValidateAntiforgeryToken]
6364
[ClosedStore(true)]
6465
[DenySystemAccount]
65-
public virtual async Task<ActionResult<ContactUsModel>> Index(
66+
public virtual async Task<IActionResult> Index(
6667
[FromServices] StoreInformationSettings storeInformationSettings,
6768
[FromServices] IPageService pageService,
6869
ContactUsModel model)

0 commit comments

Comments
 (0)