Files
KArtSell.Aegis/docs/Design/kbx-foundation-v36/backend/Modules/Common/Experiments/Rollback/Endpoint.cs
T

5 lines
643 B
C#

using FastEndpoints;using Kbx.Shared.Experiments;using Kbx.Shared.Runtime;
namespace Kbx.Modules.Common.Experiments.Rollback;
public sealed record Request(string ExperimentId,string Reason);
public sealed class Endpoint(KbxExperimentRuntimeStore store):Endpoint<Request>{public override void Configure(){Post("/api/kbx/experiments/{experimentId}/rollback");Permissions("common.experiment.manage");}public override async Task HandleAsync(Request req,CancellationToken ct){await store.RollbackAsync(RuntimeIdentity.TenantId(User),RuntimeIdentity.UserId(User),req.ExperimentId,req.Reason,HttpContext.TraceIdentifier,ct);await Send.OkAsync(ct);}}