Skip to content

Commit

Permalink
Merge pull request #380 from marchhq/meeting-order
Browse files Browse the repository at this point in the history
Meeting order
  • Loading branch information
sajdakabir authored Oct 23, 2024
2 parents a3ad8d4 + 7caffda commit b443bdd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/backend/src/services/integration/calendar.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,11 @@ const saveUpcomingMeetingsToDatabase = async (meetings, userId) => {
if (!existingMeeting) {
const newMeeting = new Meeting({
title: meeting.summary,
source: 'calendar',
id: meeting.id,
user: userId,
metadata: {
status: meeting.status,
description: meeting.description,
location: meeting.location,
attendees: meeting.attendees,
hangoutLink: meeting.hangoutLink,
Expand Down Expand Up @@ -287,7 +287,6 @@ const handleCalendarWebhookService = async (accessToken, refreshToken, userId) =
existingMeeting.title = event.summary;
existingMeeting.metadata = {
status: event.status,
description: event.description,
location: event.location,
attendees: event.attendees,
hangoutLink: event.hangoutLink,
Expand All @@ -303,6 +302,7 @@ const handleCalendarWebhookService = async (accessToken, refreshToken, userId) =
// Create new meeting
const newMeeting = new Meeting({
title: event.summary,
source: 'calendar',
id: event.id,
user: userId,
metadata: {
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/services/page/meeting.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit b443bdd

Please sign in to comment.