updated createdLoanEndpoint for obtain date of the moment at creation
This commit is contained in:
@@ -4,5 +4,4 @@ public class CreateLoanDto
|
||||
{
|
||||
public int BookId { get; set; }
|
||||
public int UserId { get; set; }
|
||||
public DateOnly Date { get; set; }
|
||||
}
|
||||
@@ -36,8 +36,8 @@ public class CreateLoanEndpoint(LibraryDbContext database) : Endpoint<CreateLoan
|
||||
{
|
||||
BookId = req.BookId,
|
||||
UserId = req.UserId,
|
||||
Date = req.Date,
|
||||
PlannedReturningDate = req.Date.AddMonths(2)
|
||||
Date = DateOnly.FromDateTime(DateTime.Now),
|
||||
PlannedReturningDate = DateOnly.FromDateTime(DateTime.Now).AddMonths(2)
|
||||
};
|
||||
|
||||
database.Loans.Add(loan);
|
||||
|
||||
Reference in New Issue
Block a user