Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Auto-register new students via URL parameter #246

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

nomadbitcoin
Copy link
Contributor

Brief Information

The type of this pull request is:

  • bug fixing
  • new feature
  • others

What does this PR do?

This PR introduces a new feature that allows users to automatically register for a course via a URL parameter. This feature is intended for use on landing pages where users have already reviewed the course information. When users click "Subscribe now" and log in, they will be automatically enrolled in the course, removing the need to revisit the course information and click "Subscribe" again.

Copy link

vercel bot commented Sep 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
web3-bootcamp-platform ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2024 11:00pm

@@ -55,7 +58,8 @@ function Course({ course, currentDate }) {
}, [user, cohort])
useEffect(async () => {
if (cohorts) {
setCohort(getCurrentCohort(user, cohorts, course, currentDate))
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't need to change this. Inlined looks better for me

@@ -241,6 +246,21 @@ function Course({ course, currentDate }) {
})
}

useEffect(() => {
const autoSubscribe = async () => {
if (auto_subscribe === 'true' && user && cohort && !userIsRegisteredInCurrentCohort()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

JavaScript convention uses camel case for variables (autoSubscribe in this case)

Name of the function is the same, so needs to find better naming also

@danicuki danicuki merged commit 0655fed into main Sep 20, 2024
4 of 5 checks passed
@nomadbitcoin nomadbitcoin deleted the chore/course-auto-registration branch September 26, 2024 19:39
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