Skip to content

Commit

Permalink
feat: meeting dates insertion in response
Browse files Browse the repository at this point in the history
  • Loading branch information
MinhxNguyen7 committed Jun 3, 2024
1 parent 00ce4a4 commit 5e9dd76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/lib/db/databaseUtils.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,13 @@ export const insertMeetingDates = async (dates: Date[], meeting_id: string) => {
return { meeting_id, date: startOfDay };
});

await db.insert(meetingDates).values(dbMeetingDates);
try {
await db.insert(meetingDates).values(dbMeetingDates);
}
catch (err) {
console.error("Error inserting meeting dates=", dbMeetingDates);
throw err;
}
};

export const getExistingMeetingDates = async (meetingId: string) => {
Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/create/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ export async function POST({ request }) {
} catch (err) {
console.error("Error creating meeting:", err, meeting, sortedDates);
// TODO: This is unsafe
throw error(500, `${err.stack}\nmeeting schema: ${JSON.stringify(meeting)}`);
throw error(500, `Error creating meeting: ${err.message}`);
}
}

0 comments on commit 5e9dd76

Please sign in to comment.