-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8e8320
commit ffa2e99
Showing
7 changed files
with
46 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,38 +88,38 @@ export async function submitApplication({ formId }: { formId: bigint }) { | |
return newObj; | ||
} | ||
|
||
// const updateSubmission = db.submissions.update({ | ||
// where: { | ||
// user_id_form_id: { | ||
// form_id: formId, | ||
// user_id: data.user.id, | ||
// }, | ||
// }, | ||
// data: { | ||
// status: "submitted", | ||
// }, | ||
// }); | ||
|
||
// const createApplication = db.applications.create({ | ||
// data: { | ||
// id: res.id!, | ||
// status: null, | ||
// reviewer_id: null, | ||
// }, | ||
// }); | ||
|
||
// await Promise.all([updateSubmission, createApplication]); | ||
// const appEmail = res.details ? (res.details as Obj) : {}; | ||
// const template = await render(SubmissionTemplate({ formTitle: form.title })); | ||
// await sendEmail({ | ||
// from: "[email protected]", | ||
// fromName: "No-reply UBC Launch Pad", | ||
// to: data.user.email!.toString(), | ||
// subject: `${form.title} - Form Submitted`, | ||
// html: template, | ||
// cc: appEmail?.email as string, | ||
// }); | ||
// return true; | ||
const updateSubmission = db.submissions.update({ | ||
where: { | ||
user_id_form_id: { | ||
form_id: formId, | ||
user_id: data.user.id, | ||
}, | ||
}, | ||
data: { | ||
status: "submitted", | ||
}, | ||
}); | ||
|
||
const createApplication = db.applications.create({ | ||
data: { | ||
id: res.id!, | ||
status: null, | ||
reviewer_id: null, | ||
}, | ||
}); | ||
|
||
await Promise.all([updateSubmission, createApplication]); | ||
const appEmail = res.details ? (res.details as Obj) : {}; | ||
const template = await render(SubmissionTemplate({ formTitle: form.title })); | ||
await sendEmail({ | ||
from: "[email protected]", | ||
fromName: "No-reply UBC Launch Pad", | ||
to: data.user.email!.toString(), | ||
subject: `${form.title} - Form Submitted`, | ||
html: template, | ||
cc: appEmail?.email as string, | ||
}); | ||
return true; | ||
} | ||
|
||
export async function updateApplication({ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters