fix error with sending responses
This commit is contained in:
@@ -16,6 +16,6 @@ public class CreateAuthorEndpoint(AuthorRepository authorRepository, AutoMapper.
|
||||
public override async Task HandleAsync(CreateAuthorDto req, CancellationToken ct)
|
||||
{
|
||||
await authorRepository.AddAsync(mapper.Map<Author>(req), ct);
|
||||
await Send.OkAsync(cancellation: ct);
|
||||
await Send.NoContentAsync(ct);
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,6 @@ public class DeleteAuthorEndpoint(AuthorRepository authorRepository) : Endpoint<
|
||||
}
|
||||
|
||||
await authorRepository.DeleteAsync(author, ct);
|
||||
await Send.OkAsync(cancellation: ct);
|
||||
await Send.NoContentAsync(ct);;
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,6 @@ public class UpdateAuthorEndpoint(AuthorRepository authorRepository, AutoMapper.
|
||||
|
||||
mapper.Map(req, author);
|
||||
await authorRepository.SaveChangesAsync(ct);
|
||||
await Send.OkAsync(cancellation: ct);
|
||||
await Send.NoContentAsync(ct);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user