Conversation
bfng72
commented
Sep 14, 2026
- enabled consent editing after submission, db will update accordingly
- added a line on dashboard if application is submitted/accepted/waiting-list to hint user that they can edit their consents on the submit page
…ter application submission
Lordfirespeed
left a comment
There was a problem hiding this comment.
Really nice work, great job! just a couple of changes and you should be good to go :)
| } | ||
|
|
||
| private async saveConsents(userId: string, payload: z.infer<typeof submitFormSchema>){ | ||
| return prisma.$transaction([ |
There was a problem hiding this comment.
probably not. no-return-await rule applies here to avoid promise overhead bc it's not in a try catch block. correct me if I'm wrong though.
There was a problem hiding this comment.
If you remove the async from the function declaration it will work as you intend.
async means the return value is wrapped in a Promise so right now this function returns Promise<Awaitable<Whatever>> so you would need to double-await wherever it is used to actually run the query inside. at the moment the query inside is never actually executing against the database (I think). Try your API route and see
so you either await the Awaitable value inside the function or don't use an async function so the Awaitable is returned plainly and can be awaited by the caller
…onsent upsert logic
|