fix: default value is null for optional body

This commit is contained in:
Polianin Nikita 2024-06-01 07:26:22 +03:00
parent fdf0ecc9ef
commit 32621515db

View File

@ -206,7 +206,7 @@ public class SetupController(ISetupToken setupToken, IMaintenanceModeNotConfigur
[HttpPost("SetLogging")]
[TokenAuthentication]
[BadRequestResponse]
public ActionResult<bool> SetLogging([FromBody] LoggingRequest? request)
public ActionResult<bool> SetLogging([FromBody] LoggingRequest? request = null)
{
var settings = (request == null) switch
{
@ -234,7 +234,7 @@ public class SetupController(ISetupToken setupToken, IMaintenanceModeNotConfigur
[HttpPost("SetEmail")]
[TokenAuthentication]
[BadRequestResponse]
public ActionResult<bool> SetEmail([FromBody] EmailRequest? request)
public ActionResult<bool> SetEmail([FromBody] EmailRequest? request = null)
{
var settings = (request == null) switch
{