Files
TeleWave/backend/src/TeleWave.Application/Broadcast/Bumpers/UpdateBumperTemplateCommandHandler.cs
T
Leonid Pershin ba3721eb92
ci / build-backend (push) Successful in 1m39s
ci / build-frontend (push) Failing after 26s
ci / tests (push) Skipped
ci / sonar (push) Skipped
Implement BumperEndpoints and remove deprecated bumper-related functionality
Added new BumperEndpoints to the API for managing bumper templates and variants, enhancing the channel management capabilities. Removed outdated bumper-related commands and handlers from the application, streamlining the codebase and improving maintainability. Updated ChannelEndpoints to reflect these changes and ensure proper routing for the new endpoints.
2026-07-27 22:01:56 +03:00

27 lines
776 B
C#

using LiteCqrs;
using TeleWave.Application.Common.Interfaces;
using TeleWave.Application.Common.Models;
namespace TeleWave.Application.Broadcast.Bumpers;
public sealed class UpdateBumperTemplateCommandHandler(IAppDbContext dbContext)
: ICommandHandler<UpdateBumperTemplateCommand, Result>
{
public async Task<Result> Handle(
UpdateBumperTemplateCommand command,
CancellationToken cancellationToken
)
{
var template = await BumperTemplateLoader.LoadAsync(
dbContext,
command.TemplateId,
cancellationToken
);
if (template is null)
return Result.Failure(BumperErrors.TemplateNotFound);
template.UpdateStyle(command.Style);
return Result.Success();
}
}