diff --git a/apps/backend/src/services/integration/calendar.service.js b/apps/backend/src/services/integration/calendar.service.js index 92e027493..27a18101c 100644 --- a/apps/backend/src/services/integration/calendar.service.js +++ b/apps/backend/src/services/integration/calendar.service.js @@ -215,6 +215,7 @@ const saveUpcomingMeetingsToDatabase = async (meetings, userId) => { if (!existingMeeting) { const newMeeting = new Meeting({ title: meeting.summary, + source: 'calender', id: meeting.id, user: userId, metadata: { @@ -301,6 +302,7 @@ const handleCalendarWebhookService = async (accessToken, refreshToken, userId) = // Create new meeting const newMeeting = new Meeting({ title: event.summary, + source: 'calender', id: event.id, user: userId, metadata: { diff --git a/apps/backend/src/services/page/meeting.service.js b/apps/backend/src/services/page/meeting.service.js index 28df742ab..7b0630c6b 100644 --- a/apps/backend/src/services/page/meeting.service.js +++ b/apps/backend/src/services/page/meeting.service.js @@ -4,7 +4,7 @@ const getMeeting = async (user) => { const meetings = await Meeting.find({ user }) - .sort({ created_at: -1 }); + .sort({ 'metadata.start.dateTime': 1 }); return meetings; };