Skip to content

Commit

Permalink
Merge pull request #114 from kubapoke/fix/rent-creation
Browse files Browse the repository at this point in the history
small stylistic change on creation of newSearchRentDto - thought it was causing a problem. It really wasn't, but there's no harm in pushing this anyway
  • Loading branch information
Egor332 authored Dec 10, 2024
2 parents 697194b + 4da3390 commit 391978f
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@ public async Task<IActionResult> CreateNewRent([FromBody] OfferInfoForNewRentDto
await _context.Rents.AddAsync(newRent);
await _context.SaveChangesAsync();

NewSearchRentDto newSearchRentDto = new NewSearchRentDto();
newSearchRentDto.Brand = rentedCar.Model.Brand.Name;
newSearchRentDto.Model = rentedCar.Model.Name;
newSearchRentDto.Email = offerInfo.Email;
newSearchRentDto.StartDate = offerInfo.StartDate;
newSearchRentDto.EndDate = offerInfo.EndDate;

var newSearchRentDto = new NewSearchRentDto
{
Brand = rentedCar.Model.Brand.Name,
Model = rentedCar.Model.Name,
Email = offerInfo.Email,
StartDate = offerInfo.StartDate,
EndDate = offerInfo.EndDate
};

return Ok(newSearchRentDto);
}
Expand Down

0 comments on commit 391978f

Please sign in to comment.