implement booking reservation change log
This commit is contained in:
@@ -24,7 +24,6 @@ const chargeBookingChanges = (changes) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (Array.isArray(changes)){
|
||||
const incidents = [];
|
||||
const errors = [];
|
||||
changes.forEach((change) => {
|
||||
const { oldReservation, newReservation } = change;
|
||||
if (oldReservation && newReservation){
|
||||
@@ -97,14 +96,10 @@ const chargeBookingChanges = (changes) => {
|
||||
}
|
||||
}
|
||||
}else{
|
||||
errors.push(change);
|
||||
// New reservation or canceled, not an incident
|
||||
}
|
||||
}
|
||||
});
|
||||
if (errors.length > 0){
|
||||
console.log('There were some errors with incomplete bookings : ');
|
||||
console.log(errors);
|
||||
}
|
||||
resolve(bulkWriteBookingChangeIncidents(incidents));
|
||||
}else{
|
||||
reject('Input argument is not an array !');
|
||||
|
||||
Reference in New Issue
Block a user