detect cancellation of newly created booking

This commit is contained in:
Bilal Catic
2019-07-30 22:28:06 +02:00
parent 095231c8a2
commit 3ccb80ad75

View File

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