Enhance documentation with new features: added dark/light/system theme support, instructions page, and application catalog. Updated API and domain model for app management and automatic migrations on startup. Improved frontend structure with new routes and features for user instructions and app management.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PnvPanel.Application.Common.Interfaces;
|
||||
using PnvPanel.Application.Common.Messaging;
|
||||
using PnvPanel.Application.Common.Models;
|
||||
|
||||
namespace PnvPanel.Application.Admin.Nodes;
|
||||
|
||||
public sealed class DeleteNodeCommandHandler(IAppDbContext dbContext, IXuiPanelGateway gateway)
|
||||
: ICommandHandler<DeleteNodeCommand, Result>
|
||||
{
|
||||
public async Task<Result> Handle(DeleteNodeCommand command, CancellationToken cancellationToken)
|
||||
{
|
||||
var node = await dbContext.Nodes.FirstOrDefaultAsync(n => n.Id == command.NodeId, cancellationToken);
|
||||
if (node is null)
|
||||
return Result.Failure(NodeErrors.NotFound);
|
||||
|
||||
var inbounds = await dbContext.Inbounds.Where(i => i.NodeId == node.Id).ToListAsync(cancellationToken);
|
||||
dbContext.Inbounds.RemoveRange(inbounds);
|
||||
dbContext.Nodes.Remove(node);
|
||||
gateway.InvalidateClient(node.Id);
|
||||
|
||||
return Result.Success();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user