Minor fixes to remove issues

This commit is contained in:
2025-02-26 22:52:27 +01:00
parent 76779afd2e
commit 7926cf2f65
2 changed files with 11 additions and 5 deletions

View File

@@ -11,7 +11,7 @@ namespace BasicDotnetTemplate.MainProject.Controllers
[Route("[controller]")]
public class AuthController : BaseController
{
private IAuthService _authService;
private readonly IAuthService _authService;
public AuthController(
IConfiguration configuration,
IAuthService authService
@@ -29,6 +29,11 @@ namespace BasicDotnetTemplate.MainProject.Controllers
{
try
{
if (!ModelState.IsValid)
{
return BadRequest("Request is not well formed");
}
if (
request == null ||
request.Data == null ||
@@ -50,9 +55,9 @@ namespace BasicDotnetTemplate.MainProject.Controllers
catch (Exception exception)
{
var message = "Something went wrong";
if (!String.IsNullOrEmpty(exception?.Message))
if (!String.IsNullOrEmpty(exception.Message))
{
message += $". {exception?.Message}";
message += $". {exception.Message}";
}
return InternalServerError(message);
}