fixed errors and finish endpoints
This commit is contained in:
@@ -27,6 +27,12 @@ public class DeleteAuthorEndpoint(AuthorRepository authorRepository) : Endpoint<
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
if (author.Books?.Count > 0)
|
||||
{
|
||||
await Send.StringAsync("L'auteur possède encore des livres",409, cancellation: ct);
|
||||
return;
|
||||
}
|
||||
|
||||
await authorRepository.DeleteAsync(author, ct);
|
||||
await Send.OkAsync(cancellation: ct);
|
||||
|
||||
Reference in New Issue
Block a user