-
Notifications
You must be signed in to change notification settings - Fork 0
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
Link route election/joel #65
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
b696123
to
e7f9f45
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minors, but looks good!
Remove the route.ts file under |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a minor comment
src/packages/DAO/elections.dao.ts
Outdated
@@ -48,7 +48,7 @@ export async function startElection(formData: FormData) { | |||
}, | |||
}); | |||
|
|||
revalidatePath("/"); | |||
redirect(`http://localhost:3000/elections/${electionId}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to setup this as a environment var called APP_BASE_URL as this will change depending on environment.
With the redirect command, in this case here, you can also omit the base url and send only the paths ahead, like:
redirect(`http://localhost:3000/elections/${electionId}`); | |
redirect(`elections/${electionId}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for adding the env var as I mentioned if you follow this alternative
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change here 2b69f27
Description
I added a new route to handle redirection based on an election ID. This route captures the ID from the URL to fetch election details from the database.
Changes
Notes
Board issue