fix error with sending responses
This commit is contained in:
@@ -52,6 +52,6 @@ public class CreateLoanEndpoint(LoanRepository loanRepository, BookRepository bo
|
||||
}
|
||||
|
||||
await loanRepository.AddAsync(mapper.Map<Loan>(req), ct);
|
||||
await Send.OkAsync(cancellation: ct);
|
||||
await Send.NoContentAsync(ct);
|
||||
}
|
||||
}
|
||||
@@ -25,11 +25,11 @@ public class PatchReturnLoanEndpoint(LoanRepository loanRepository) : Endpoint<P
|
||||
if (loan is null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
await Send.OkAsync(cancellation: ct);
|
||||
return;
|
||||
}
|
||||
|
||||
loan?.ReturnDate = req.ReturnDate;
|
||||
await loanRepository.SaveChangesAsync(ct);
|
||||
await Send.OkAsync(cancellation: ct);
|
||||
await Send.NoContentAsync(ct);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user