Ajoute les notices sources et le renommage fusionné des auteurs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot
parent
6b8f08ef26
commit
e28d5bce32
@@ -186,6 +186,31 @@ public static class LivresEndpoints
|
||||
.Produces<AuteurDto>()
|
||||
.Produces(StatusCodes.Status404NotFound);
|
||||
|
||||
groupe.MapPut("/{id:int}", async (
|
||||
int id,
|
||||
RenommerAuteur demande,
|
||||
bool? confirmerFusion,
|
||||
IServiceAuteurs service,
|
||||
CancellationToken ct) =>
|
||||
{
|
||||
var resultat = await service.RenommerAsync(
|
||||
id, demande.Nom, confirmerFusion ?? false, ct);
|
||||
|
||||
if (resultat.Auteur is null && resultat.Collision is null)
|
||||
{
|
||||
return Results.NotFound();
|
||||
}
|
||||
|
||||
return resultat.Collision is not null
|
||||
? Results.Conflict(resultat)
|
||||
: Results.Ok(resultat);
|
||||
})
|
||||
.WithName("RenommerAuteur")
|
||||
.WithSummary("Renomme un auteur ou fusionne sa fiche avec une fiche existante.")
|
||||
.Produces<ResultatRenommageAuteur>()
|
||||
.Produces(StatusCodes.Status404NotFound)
|
||||
.Produces(StatusCodes.Status409Conflict);
|
||||
|
||||
groupe.MapGet("/rapprochements", async (IServiceAuteurs service, CancellationToken ct) =>
|
||||
Results.Ok(await service.SuggestionsAsync(ct)))
|
||||
.WithName("ListerRapprochements")
|
||||
|
||||
Reference in New Issue
Block a user