Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Update ContactController.cs

support63dd01408224
diff --git a/src/Web/Grand.Web/Controllers/ContactController.cs b/src/Web/Grand.Web/Controllers/ContactController.cs
index 88b8c8fcf..25e10d4cc 100644
--- a/src/Web/Grand.Web/Controllers/ContactController.cs
+++ b/src/Web/Grand.Web/Controllers/ContactController.cs
@@ -43,6 +43,7 @@ public class ContactController : BasePublicController
//available even when a store is closed
[ClosedStore(true)]
[HttpGet]
+ [ProducesResponseType(typeof(ContactUsModel), StatusCodes.Status200OK)]
public virtual async Task<IActionResult> Index(
[FromServices] StoreInformationSettings storeInformationSettings,
[FromServices] IPageService pageService)
@@ -63,6 +64,7 @@ public class ContactController : BasePublicController
}
[HttpPost]
+ [ProducesResponseType(typeof(ContactUsModel), StatusCodes.Status200OK)]
[AutoValidateAntiforgeryToken]
[ClosedStore(true)]
[DenySystemAccount]
diff --git a/src/Web/Grand.Web/Models/Contact/ContactUsModel.cs b/src/Web/Grand.Web/Models/Contact/ContactUsModel.cs
index 5f9770f80..f4473203d 100644
--- a/src/Web/Grand.Web/Models/Contact/ContactUsModel.cs
+++ b/src/Web/Grand.Web/Models/Contact/ContactUsModel.cs
@@ -2,7 +2,6 @@
using Grand.Domain.Common;
using Grand.Infrastructure.ModelBinding;
using Grand.Infrastructure.Models;
-using Grand.SharedKernel.Attributes;
using Grand.Web.Common.Binders;
using Grand.Web.Common.Models;
using Grand.Web.Models.Common;
@@ -18,41 +17,24 @@ namespace Grand.Web.Models.Contact
ContactAttribute = new List<CustomAttribute>();
Attributes = new List<CustomAttributeModel>();
}
-
[GrandResourceDisplayName("ContactUs.Email")]
public string Email { get; set; }
-
[GrandResourceDisplayName("ContactUs.Subject")]
public string Subject { get; set; }
- [IgnoreApi]
public bool SubjectEnabled { get; set; }
-
[GrandResourceDisplayName("ContactUs.Enquiry")]
public string Enquiry { get; set; }
-
[GrandResourceDisplayName("ContactUs.FullName")]
public string FullName { get; set; }
-
- [IgnoreApi]
public bool SuccessfullySent { get; set; }
- [IgnoreApi]
public string Result { get; set; }
-
- [IgnoreApi]
public bool DisplayCaptcha { get; set; }
public ICaptchaValidModel Captcha { get; set; } = new CaptchaModel();
-
[ModelBinder(BinderType = typeof(CustomAttributesBinder))]
public IList<CustomAttributeModel> Attributes { get; set; }
-
- [IgnoreApi]
public string ContactAttributeInfo { get; set; }
- [IgnoreApi]
public IList<CustomAttribute> ContactAttribute { get; set; }
-
- [IgnoreApi]
public IList<ContactAttributeModel> ContactAttributes { get; set; }
-
public class ContactAttributeModel : BaseEntityModel
{
public ContactAttributeModel()
@@ -60,15 +42,10 @@ namespace Grand.Web.Models.Contact
AllowedFileExtensions = new List<string>();
Values = new List<ContactAttributeValueModel>();
}
-
public string Name { get; set; }
-
public string DefaultValue { get; set; }
-
public string TextPrompt { get; set; }
-
public bool IsRequired { get; set; }
-
/// <summary>
/// Selected day value for datepicker
/// </summary>
@@ -81,26 +58,19 @@ namespace Grand.Web.Models.Contact
/// Selected year value for datepicker
/// </summary>
public int? SelectedYear { get; set; }
-
/// <summary>
/// Allowed file extensions for customer uploaded files
/// </summary>
public IList<string> AllowedFileExtensions { get; set; }
-
public AttributeControlType AttributeControlType { get; set; }
-
public IList<ContactAttributeValueModel> Values { get; set; }
}
public class ContactAttributeValueModel : BaseEntityModel
{
public string Name { get; set; }
-
public int DisplayOrder { get; set; }
-
public string ColorSquaresRgb { get; set; }
-
-
public bool IsPreSelected { get; set; }
}
}