fix undefined hourlyRate bug

This commit is contained in:
Bilal Catic
2019-07-19 12:16:20 +02:00
parent 96e12db213
commit ef40483c22
2 changed files with 2 additions and 2 deletions

View File

@@ -35,7 +35,7 @@ const chargeBookingChanges = (changes) => {
const newEnd = newReservation.end ? moment.utc(newReservation.end) : null;
const reservationTimezone = newReservation.timezone ? newReservation.timezone : UI_TIMEZONE;
const reservationHourlyRate = oldReservation.hourlyRate ? oldReservation.hourlyRate : undefined;
const reservationHourlyRate = oldReservation.hourlyRate ? oldReservation.hourlyRate : newReservation.hourlyRate;
const canceled = newReservation.canceled;
if (oldStart && oldEnd && newStart && newEnd && reservationHourlyRate){

View File

@@ -184,7 +184,7 @@ const bulkWriteReservationsWithChangesTracking = (reservations) => {
}
});
instance.setDataValue('hourlyRate', previous.hourlyRate);
instance.setDataValue('hourlyRate', instance.previous('hourlyRate'));
if (realChange){
changes.push({