Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
EMcNugget committed Nov 12, 2024
1 parent 2d6581b commit dddcdd2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
6 changes: 1 addition & 5 deletions src/routes/(authed)/dash/sessions/[sessionId]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@
const now = DateTime.now();
const interval = start_time.diff(now, 'hours');
if (interval.hours < 24) {
return false;
} else {
return true;
}
return interval.hours < 24;
}
async function cancel() {
Expand Down
24 changes: 15 additions & 9 deletions src/routes/(authed)/schedule/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ export const load: PageServerLoad = async ({ cookies, url }) => {

const slotData = slottificate(sTypes, mentors, allSessions);

const originalSessionType = url.searchParams.has('reschedule') ? url.searchParams.get('type') : null;
const originalSessionType = url.searchParams.has('reschedule')
? url.searchParams.get('type')
: null;

return {
user,
Expand All @@ -194,7 +196,7 @@ export const load: PageServerLoad = async ({ cookies, url }) => {
isDeveloper: roleOf(user) >= ROLE_DEVELOPER,
sessionTypes: sTypes,
slotData,
originalSessionType
originalSessionType
};
};

Expand Down Expand Up @@ -280,17 +282,21 @@ export const actions: Actions = {
type: requestedType
});

const subject = reschedule
? 'Appointment updated'
: 'Appointment booked' +
' - ' +
start.setZone(timezone).toLocaleString(DateTime.DATETIME_HUGE);

if (reschedule) {
await db.delete(sessions).where(eq(sessions.id, orginalSessionId));
}

await sendEmail(user.email, subject, studentEmailContent.raw, studentEmailContent.html);
await sendEmail(
user.email,
reschedule
? 'Appointment updated'
: 'Appointment booked' +
' - ' +
start.setZone(timezone).toLocaleString(DateTime.DATETIME_HUGE),
studentEmailContent.raw,
studentEmailContent.html
);

await sendEmail(
mentor.email,
'New session booked - ' +
Expand Down

0 comments on commit dddcdd2

Please sign in to comment.