Add maintenance management features: implement maintenance endpoints in the API, enhance media upload handling to skip duplicate files, and update frontend routes and translations for maintenance operations.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
using LiteCqrs;
|
||||
using TeleWave.Application.Common.Models;
|
||||
|
||||
namespace TeleWave.Application.Maintenance.DeleteAllShows;
|
||||
|
||||
/// <summary>Удаляет ВСЕ шоу (с сериями через каскад). Медиа-ассеты остаются в библиотеке.</summary>
|
||||
public sealed record DeleteAllShowsCommand : ICommand<Result<int>>;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
using LiteCqrs;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using TeleWave.Application.Common.Interfaces;
|
||||
using TeleWave.Application.Common.Models;
|
||||
|
||||
namespace TeleWave.Application.Maintenance.DeleteAllShows;
|
||||
|
||||
public sealed class DeleteAllShowsCommandHandler(IAppDbContext dbContext)
|
||||
: ICommandHandler<DeleteAllShowsCommand, Result<int>>
|
||||
{
|
||||
public async Task<Result<int>> Handle(
|
||||
DeleteAllShowsCommand command,
|
||||
CancellationToken cancellationToken
|
||||
)
|
||||
{
|
||||
// Серии удаляются каскадом (FK Show → ShowEpisode: OnDelete Cascade).
|
||||
var deleted = await dbContext.Shows.ExecuteDeleteAsync(cancellationToken);
|
||||
return Result.Success(deleted);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user