using EnablementBLL.ShowSpace; using EnablementSL.Parameters.ShowSpaceSubscription; using FastEndpoints; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; namespace EnablementSL.Endpoints.ShowSpaceSubscription; public class SetSpaceSubscription : BaseEndpoint> { private readonly IShowSpaceSubscriptionBLL _bll; public SetSpaceSubscription(IShowSpaceSubscriptionBLL bll) => _bll = bll; public override void Configure() { Post("/Enablement/SetSpaceSubscription"); AllowAnonymous(); } protected override string? GetCacheKey(SetSpaceSubscriptionParameters req, LoginDTO login) => null; protected override async Task> ExecuteAsync( SetSpaceSubscriptionParameters req, LoginDTO login, CancellationToken ct) => await _bll.SetSubscriptionAsync(req.SpaceId, req.IsSubscribed, login, ct).ConfigureAwait(false); }