fix undefined hourlyRate bug
This commit is contained in:
@@ -35,7 +35,7 @@ const chargeBookingChanges = (changes) => {
|
|||||||
const newEnd = newReservation.end ? moment.utc(newReservation.end) : null;
|
const newEnd = newReservation.end ? moment.utc(newReservation.end) : null;
|
||||||
|
|
||||||
const reservationTimezone = newReservation.timezone ? newReservation.timezone : UI_TIMEZONE;
|
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;
|
const canceled = newReservation.canceled;
|
||||||
|
|
||||||
if (oldStart && oldEnd && newStart && newEnd && reservationHourlyRate){
|
if (oldStart && oldEnd && newStart && newEnd && reservationHourlyRate){
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ const bulkWriteReservationsWithChangesTracking = (reservations) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
instance.setDataValue('hourlyRate', previous.hourlyRate);
|
instance.setDataValue('hourlyRate', instance.previous('hourlyRate'));
|
||||||
|
|
||||||
if (realChange){
|
if (realChange){
|
||||||
changes.push({
|
changes.push({
|
||||||
|
|||||||
Reference in New Issue
Block a user