SES-154 Add Endpoint to change shopkeeper status

This commit is contained in:
Karol Górzyński 2021-01-20 19:57:20 +01:00
parent dde7039ad4
commit 0b29aca44d

View File

@ -5,6 +5,7 @@ using SessionCompanion.ViewModels.ApiResponses;
using SessionCompanion.ViewModels.ShopkeeperViewModels;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
@ -29,5 +30,17 @@ namespace SessionCompanion.Controllers
{
return _service.Get().ToList();
}
/// <summary>
/// Endpoint służacy do zmiany statusu sklepikarza
/// </summary>
/// <param name="shopkeeperId"></param>
/// <param name="availability"></param>
/// <returns>SuccesResponse/ErrorResponse</returns>
[HttpPut("changeShopkeeperStatus")]
public async Task<Either<SuccessResponse, ErrorResponse>> ChangeShopkeeperStatus([Required] int shopkeeperId, [Required] bool availability)
{
return await _service.ChangeShopkeeperStatus(shopkeeperId, availability);
}
}
}