This commit is contained in:
@@ -45,9 +45,14 @@ namespace rockfishCore.Controllers
|
|||||||
|
|
||||||
|
|
||||||
[HttpPost("reply/{account}/{id}")]
|
[HttpPost("reply/{account}/{id}")]
|
||||||
public JsonResult Reply([FromRoute] string account, [FromRoute] uint id, [FromBody] dtoReplyMessageItem m)
|
public ActionResult Reply([FromRoute] string account, [FromRoute] uint id, [FromBody] dtoReplyMessageItem m)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(m.composition))
|
if (!ModelState.IsValid)
|
||||||
|
{
|
||||||
|
return BadRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m==null || string.IsNullOrWhiteSpace(m.composition))
|
||||||
{
|
{
|
||||||
return Json(new { msg = "MailController:Reply->There is no reply text", error = 1 });
|
return Json(new { msg = "MailController:Reply->There is no reply text", error = 1 });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace rockfishCore
|
|||||||
// This method gets called by the runtime. Use this method to add services to the container.
|
// This method gets called by the runtime. Use this method to add services to the container.
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddControllers();
|
services.AddControllers().AddNewtonsoftJson();
|
||||||
services.AddDbContext<rockfishContext>(options =>
|
services.AddDbContext<rockfishContext>(options =>
|
||||||
{
|
{
|
||||||
options.UseSqlite(Configuration.GetConnectionString("rfdb")).EnableSensitiveDataLogging(false);
|
options.UseSqlite(Configuration.GetConnectionString("rfdb")).EnableSensitiveDataLogging(false);
|
||||||
@@ -111,9 +111,8 @@ namespace rockfishCore
|
|||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
|
||||||
app.UseEndpoints(endpoints =>
|
app.UseEndpoints(endpoints =>
|
||||||
{
|
{
|
||||||
endpoints.MapControllers();
|
endpoints.MapControllers();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<PackageReference Include="jose-jwt" Version="2.5.0" />
|
<PackageReference Include="jose-jwt" Version="2.5.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.4" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.4" />
|
||||||
<PackageReference Include="mailkit" Version="2.7.0" />
|
<PackageReference Include="mailkit" Version="2.7.0" />
|
||||||
<!-- <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.4" /> -->
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
Reference in New Issue
Block a user