Skip to content

feat: edit consents after submission - #285

Open
bfng72 wants to merge 3 commits into
mainfrom
consent-editing
Open

bfng72 wants to merge 3 commits into
mainfrom
consent-editing

Conversation

@bfng72

@bfng72 bfng72 commented Sep 14, 2026

Copy link
Copy Markdown
  • 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

@Lordfirespeed Lordfirespeed left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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([

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing await?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Lordfirespeed Lordfirespeed Sep 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread server/src/routes/application/application-handlers.ts Outdated
Comment thread client/src/app/dashboard/(application)/(status)/page.tsx Outdated
@bfng72

bfng72 commented Sep 15, 2026

Copy link
Copy Markdown
Author
  • fixed the transaction part that violates ACID
  • consent notice made into a separate component for DRY purposes as requested
  • (pls correct me if im wrong about the missing await one)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants