@@ -345,7 +345,7 @@ module.exports = {
345345 *
346346 * @return {Promise<RecentEventSchema[]> }
347347 */
348- async dailyEventsPortion ( project , { limit, cursor , sort, filters, search } ) {
348+ async dailyEventsPortion ( project , { limit, nextCursor , sort, filters, search } ) {
349349 if ( search ) {
350350 if ( search . length > MAX_SEARCH_QUERY_LENGTH ) {
351351 search = search . slice ( 0 , MAX_SEARCH_QUERY_LENGTH ) ;
@@ -354,15 +354,15 @@ module.exports = {
354354
355355 const factory = new EventsFactory ( project . _id ) ;
356356
357- const dailyEventsPortion = await factory . findRecentDailyEventsWithEventAndRepetition ( limit , cursor , sort , filters , search ) ;
357+ const dailyEventsPortion = await factory . findRecentDailyEventsWithEventAndRepetition ( limit , nextCursor , sort , filters , search ) ;
358358
359359 dailyEventsPortion . dailyEvents . forEach ( ( dailyEvent ) => {
360360 const dailyEventLatestRepetition = dailyEvent . repetition ;
361361 const dailyEventOriginalEvent = dailyEvent . event ;
362362
363363 const mergedRepetition = composeFullRepetitionEvent ( dailyEventOriginalEvent , dailyEventLatestRepetition ) ;
364364 const stringifiedId = dailyEvent . _id . toString ( ) ;
365-
365+ mergedRepetition . firstAppearanceTimestamp = dailyEvent . event . timestamp ;
366366
367367 delete dailyEvent . repetition ;
368368 delete dailyEvent . event ;
@@ -374,7 +374,7 @@ module.exports = {
374374 return dailyEvent ;
375375 } )
376376
377- console . log ( 'daily events portion composed, ...[event]' , dailyEventsPortion ) ;
377+ console . log ( 'daily events portion composed, ...[event]' , dailyEventsPortion . dailyEvents [ 0 ] . event ) ;
378378
379379 return dailyEventsPortion ;
380380 } ,
0 commit comments