Fix undetected booking changes #30

Merged
bilal.catic merged 2 commits from fix-undetected-booking-changes into master 2019-07-31 10:07:12 +02:00
Showing only changes of commit 3ccb80ad75 - Show all commits

View File

@@ -23,11 +23,18 @@ const bulkWriteChanges = ((changes) => {
}; };
if (!oldReservation.start && !oldReservation.end && !oldReservation.resourceId){ if (!oldReservation.start && !oldReservation.end && !oldReservation.resourceId){
if (newReservation.canceled){
//new reservation created and canceled immediately
logEntry.oldResourceId = resourceId;
logEntry.oldStart = start;
logEntry.newEnd = end;
}else{
// new reservation // new reservation
logEntry.oldResourceId = null; logEntry.oldResourceId = null;
logEntry.oldStart = null; logEntry.oldStart = null;
logEntry.oldEnd = null; logEntry.oldEnd = null;
} }
}
if (newReservation.canceled){ if (newReservation.canceled){
logEntry.newResourceId = null; logEntry.newResourceId = null;