SES-152 Endpoint zwracający sklepikarzy #79

Merged
s426134 merged 11 commits from SES-152 into dev 2021-01-20 19:26:12 +01:00
Showing only changes of commit 22069cae7d - Show all commits

View File

@ -25,12 +25,9 @@ namespace SessionCompanion.Controllers
/// </summary> /// </summary>
/// <returns>Lista sklepikarzy</returns> /// <returns>Lista sklepikarzy</returns>
[HttpGet("getShopkeepers")] [HttpGet("getShopkeepers")]
public async Task<Either<ErrorResponse, List<ShopkeeperViewModel>>> GetShopkeepers() public async Task<List<ShopkeeperViewModel>> GetShopkeepers()
{ {
var shopkeepers = _service.Get(); return _service.Get().ToList();
if (!shopkeepers.Any())
return new ErrorResponse() { StatusCode = 204, Message = "No shopkeepers in database" };
return shopkeepers.ToList();
} }
} }
} }