Added initial voice work edit logic (set favorite / delete) on Api and UI layers.
All checks were successful
ci / build-test (push) Successful in 2m44s
ci / publish-image (push) Successful in 1m45s

This commit is contained in:
2026-05-07 00:07:20 -04:00
parent 2bd7e3b970
commit 9c9e33ebec
14 changed files with 291 additions and 57 deletions

View File

@@ -5,6 +5,8 @@ using JSMR.Application.Tags.Commands.SetEnglishName;
using JSMR.Application.Tags.Commands.UpdateTagStatus;
using JSMR.Application.Tags.Queries.Search;
using JSMR.Application.Users;
using JSMR.Application.VoiceWorks.Commands.Delete;
using JSMR.Application.VoiceWorks.Commands.SetFavorite;
using JSMR.Application.VoiceWorks.Queries.Search;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
@@ -59,6 +61,7 @@ public static class WebApplicationExtensions
app.MapGet("/health", () => Results.Ok(new { status = "ok" }));
app.MapSearchEndpoints();
app.MapVoiceWorkCommandEndpoints();
app.MapTagCommandEndpoints();
app.MapCreatorCommandEndpoints();
app.MapAuthenticationEndpoints();
@@ -110,6 +113,27 @@ public static class WebApplicationExtensions
});
}
private static void MapVoiceWorkCommandEndpoints(this WebApplication app)
{
app.MapPost("/api/voicework/set-favorite", async (
SetVoiceWorkFavoriteRequest request,
SetVoiceWorkFavoriteHandler handler,
CancellationToken ct) =>
{
var result = await handler.HandleAsync(request, ct);
return Results.Ok(result);
});
app.MapPost("/api/voicework/delete", async (
DeleteVoiceWorkRequest request,
DeleteVoiceWorkHandler handler,
CancellationToken ct) =>
{
var result = await handler.HandleAsync(request, ct);
return Results.Ok(result);
});
}
private static void MapTagCommandEndpoints(this WebApplication app)
{
app.MapPost("/api/tags/update-status", async (