fixed error
This commit is contained in:
@@ -4,4 +4,5 @@ public class CreateLoanDto
|
|||||||
{
|
{
|
||||||
public int BookId { get; set; }
|
public int BookId { get; set; }
|
||||||
public int UserId { 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,
|
BookId = req.BookId,
|
||||||
UserId = req.UserId,
|
UserId = req.UserId,
|
||||||
Date = DateOnly.FromDateTime(DateTime.Now),
|
Date = req.Date,
|
||||||
PlannedReturningDate = DateOnly.FromDateTime(DateTime.Now).AddMonths(2)
|
PlannedReturningDate = req.Date.AddMonths(2)
|
||||||
};
|
};
|
||||||
|
|
||||||
database.Loans.Add(loan);
|
database.Loans.Add(loan);
|
||||||
|
|||||||
Reference in New Issue
Block a user