add mapping; store resourceId in doorLockEvents table
This commit is contained in:
@@ -15,7 +15,7 @@ const fetchAllBookings = () => {
|
||||
cleanedBookingReservations.push({
|
||||
reservationId: fullBookingEntry['_id'],
|
||||
memberId: fullBookingEntry.member,
|
||||
resource: fullBookingEntry.resourceId,
|
||||
resourceId: fullBookingEntry.resourceId,
|
||||
start: fullBookingEntry.start.dateTime,
|
||||
end: fullBookingEntry.end.dateTime,
|
||||
});
|
||||
@@ -29,9 +29,7 @@ const fetchAllBookings = () => {
|
||||
};
|
||||
|
||||
const writeBookingReservation = (bookingReservation) => {
|
||||
db.bookingReservation.findOrCreate({where: {...bookingReservation}, defaults: {...bookingReservation}})
|
||||
.then()
|
||||
.catch();
|
||||
return db.bookingReservation.findOrCreate({where: {...bookingReservation}, defaults: {...bookingReservation}});
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user