do not add reservations to the db for tentative and free bookings
This commit is contained in:
@@ -116,6 +116,8 @@ const fetchAllBookings = () => {
|
|||||||
const fees = fullBookingEntry && fullBookingEntry.fees ? fullBookingEntry.fees : [];
|
const fees = fullBookingEntry && fullBookingEntry.fees ? fullBookingEntry.fees : [];
|
||||||
const firstFee = fees.length > 0 && fees[0].fee ? fees[0].fee : undefined;
|
const firstFee = fees.length > 0 && fees[0].fee ? fees[0].fee : undefined;
|
||||||
const hourlyRate = firstFee && firstFee.price ? firstFee.price : 0;
|
const hourlyRate = firstFee && firstFee.price ? firstFee.price : 0;
|
||||||
|
const free = fullBookingEntry.free ? fullBookingEntry.free : false;
|
||||||
|
const tentative = fullBookingEntry.tentative ? fullBookingEntry.tentative : false;
|
||||||
|
|
||||||
const startMoment = fullBookingEntry && fullBookingEntry.start && fullBookingEntry.start.dateTime ?
|
const startMoment = fullBookingEntry && fullBookingEntry.start && fullBookingEntry.start.dateTime ?
|
||||||
moment.utc(fullBookingEntry.start.dateTime) : null;
|
moment.utc(fullBookingEntry.start.dateTime) : null;
|
||||||
@@ -126,7 +128,7 @@ const fetchAllBookings = () => {
|
|||||||
// console.log('End : ', endMoment.clone().tz(fullBookingEntry.timezone).format('DD.MM. HH:mm'), '[', endMoment.toISOString(), ']');
|
// console.log('End : ', endMoment.clone().tz(fullBookingEntry.timezone).format('DD.MM. HH:mm'), '[', endMoment.toISOString(), ']');
|
||||||
// console.log('Fees : ');
|
// console.log('Fees : ');
|
||||||
|
|
||||||
if (startMoment && endMoment){
|
if (startMoment && endMoment && !free && !tentative){
|
||||||
cleanedBookingReservations.push({
|
cleanedBookingReservations.push({
|
||||||
reservationId: fullBookingEntry['_id'],
|
reservationId: fullBookingEntry['_id'],
|
||||||
memberId: fullBookingEntry.member,
|
memberId: fullBookingEntry.member,
|
||||||
|
|||||||
Reference in New Issue
Block a user