controller update

This commit is contained in:
Łukasz Góreczny 2021-01-21 18:29:41 +01:00
parent 0e0079d973
commit b0aaea1474

View File

@ -21,6 +21,7 @@ namespace SessionCompanion.Controllers
{
_service = shopkeeperService;
}
/// <summary>
/// Endpoint zwracający liste sklepikarzy
/// </summary>
@ -42,5 +43,13 @@ namespace SessionCompanion.Controllers
{
return await _service.ChangeShopkeeperStatus(shopkeeperId, availability);
}
[HttpPost("createNewShopkeeper")]
public async Task<Either<SuccessResponse, ErrorResponse>> CreateNewShopKeeper([Required] ShopkeeperWithItemsViewModel shopkeeperWithItemsViewModel)
{
if (!ModelState.IsValid)
return new ErrorResponse() { StatusCode = 500, Message = "Model is invalid" };
return await _service.CreateNewShopKeeper(shopkeeperWithItemsViewModel);
}
}
}