@@ -2164,7 +2164,7 @@ router.post('/booking_history_by_time/:id', verifyToken, (req, res, next) => {
2164
2164
Booking . find ( { booking_status :{ $in :[ "booked" , "completed" , "cancelled" ] } , booking_date :{ $gte :req . body . fromdate , $lte :req . body . todate } , venue_id :req . params . id , start_time :{ $gte :req . body . start_time } , end_time :{ $lte :req . body . end_time } , repeat_booking :true } ) . lean ( ) . populate ( 'venue_data' , 'venue' ) . populate ( 'collected_by' , 'name' ) . populate ( 'cancelled_by' , 'name' ) . then ( booking => {
2165
2165
result = Object . values ( combineRepeatSlots ( booking ) )
2166
2166
let status_filter = result . filter ( ( b ) => b . booking_status === 'cancelled' )
2167
- let grouped = _ . mapValues ( _ . groupBy ( result , 'group_id ' ) , clist => clist . map ( result => _ . omit ( result , 'multiple_id' ) ) ) ;
2167
+ let grouped = _ . mapValues ( _ . groupBy ( result , 'repeat_id ' ) , clist => clist . map ( result => _ . omit ( result , 'multiple_id' ) ) ) ;
2168
2168
let x = { }
2169
2169
let finalBookingList = [ ]
2170
2170
Object . entries ( grouped ) . map ( ( [ i , j ] ) => {
@@ -2215,7 +2215,7 @@ router.post('/booking_history_by_time/:id', verifyToken, (req, res, next) => {
2215
2215
router . post ( '/booking_history_by_group_id/:id' , verifyToken , ( req , res , next ) => {
2216
2216
Booking . find ( { booking_status :{ $in :[ "booked" , "cancelled" , "completed" ] } , venue_id :req . params . id , group_id :{ $in :req . body . group_id } , repeat_booking :true , invoice :false } ) . lean ( ) . populate ( 'venue_data' , 'venue' ) . populate ( 'collected_by' , 'name' ) . populate ( 'cancelled_by' , 'name' ) . then ( booking => {
2217
2217
result = Object . values ( combineRepeatSlots ( booking ) )
2218
- let grouped = _ . mapValues ( _ . groupBy ( result , 'group_id ' ) , clist => clist . map ( result => _ . omit ( result , 'multiple_id' ) ) ) ;
2218
+ let grouped = _ . mapValues ( _ . groupBy ( result , 'repeat_id ' ) , clist => clist . map ( result => _ . omit ( result , 'multiple_id' ) ) ) ;
2219
2219
let x = { }
2220
2220
let finalBookingList = [ ]
2221
2221
Object . entries ( grouped ) . map ( ( [ i , j ] ) => {
0 commit comments