controller update
This commit is contained in:
parent
0e0079d973
commit
b0aaea1474
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user