diff --git a/Streetcode/Streetcode.BLL/MediatR/Newss/GetNewsAndLinksByUrl/GetNewsAndLinksByUrlHandler.cs b/Streetcode/Streetcode.BLL/MediatR/Newss/GetNewsAndLinksByUrl/GetNewsAndLinksByUrlHandler.cs index f17e24372..eba993f2f 100644 --- a/Streetcode/Streetcode.BLL/MediatR/Newss/GetNewsAndLinksByUrl/GetNewsAndLinksByUrlHandler.cs +++ b/Streetcode/Streetcode.BLL/MediatR/Newss/GetNewsAndLinksByUrl/GetNewsAndLinksByUrlHandler.cs @@ -40,7 +40,7 @@ public async Task> Handle(GetNewsAndLinksByUrlQuery requ { string errorMsg = _stringLocalizerNo["NoNewsByEnteredUrl", url].Value; _logger.LogError(request, errorMsg); - return Result.Fail(errorMsg); + return Result.Ok(); } if (newsDTO.Image is not null) @@ -95,7 +95,6 @@ public async Task> Handle(GetNewsAndLinksByUrlQuery requ { string errorMsg = _stringLocalizerNo["NoNewsByEnteredUrl", url].Value; _logger.LogError(request, errorMsg); - return Result.Fail(errorMsg); } return Result.Ok(newsDTOWithUrls); diff --git a/Streetcode/Streetcode.WebApi/Controllers/BaseApiController.cs b/Streetcode/Streetcode.WebApi/Controllers/BaseApiController.cs index 05c90c1e9..a0b27654f 100644 --- a/Streetcode/Streetcode.WebApi/Controllers/BaseApiController.cs +++ b/Streetcode/Streetcode.WebApi/Controllers/BaseApiController.cs @@ -34,9 +34,10 @@ protected ActionResult HandleResult(Result result) } return (result.Value is null) ? + NotFound("Not Found") : Ok(result.Value); } return BadRequest(result.Reasons); - } + } } \ No newline at end of file