Skip to content

Commit 5914b2f

Browse files
author
Paul Frank
committed
Delete tableId when creating booking 🤦‍♂️
1 parent 901a74b commit 5914b2f

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

TableBookingAPI/TableBooking.Model/Dtos/BookingDtos/CreateBookingDto.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ public class CreateBookingDto
77
public DateTime Date { get; set; }
88
public int DurationInMinutes { get; set; }
99
public int AmountOfPeople { get; set; }
10-
public Guid TableId { get; set; }
1110
}
1211
}

TableBookingAPI/TableBooking/Services/BookingService.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ public BookingService(IUnitOfWork unitOfWork, ITableConverter tableConverter, IT
2222
}
2323
public async Task<IActionResult> CreateBookingAsync(CreateBookingDto request, Guid userId)
2424
{
25-
var table = await _tableService.GetTableObjectByIdAsync(request.TableId);
26-
2725
var newBooking = new Booking
2826
{
2927
Date = request.Date,
3028
DurationInMinutes = request.DurationInMinutes,
31-
TableId = request.TableId,
29+
TableId = Guid.NewGuid(),
3230
AppUserId = userId,
3331
AmountOfPeople = request.AmountOfPeople
3432
};

0 commit comments

Comments
 (0)