Fix bug with calendar
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
const db = require('../../models/index');
|
||||
|
||||
const bulkWriteChanges = ((changes) => {
|
||||
const bulkWriteChanges = (changes) => {
|
||||
const changeLogsForDB = [];
|
||||
|
||||
changes.forEach((change) => {
|
||||
@@ -48,8 +48,19 @@ const bulkWriteChanges = ((changes) => {
|
||||
return db.bookingReservationChangeLog.bulkCreate(changeLogsForDB);
|
||||
// console.log(changeLogsForDB);
|
||||
// return new Promise((resolve) => resolve());
|
||||
});
|
||||
};
|
||||
|
||||
const getBookingChangeLogsForReservationId = (reservationId) => {
|
||||
const filter = {
|
||||
reservationId,
|
||||
};
|
||||
|
||||
const order = [['createdAt', 'ASC']];
|
||||
|
||||
return db.bookingReservationChangeLog.findAll({where: filter, order});
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
bulkWriteChanges,
|
||||
getBookingChangeLogsForReservationId,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user