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

Enable application submission to backend route #90

Closed
samderanova opened this issue Dec 16, 2023 · 3 comments · Fixed by #97 or #125
Closed

Enable application submission to backend route #90

samderanova opened this issue Dec 16, 2023 · 3 comments · Fixed by #97 or #125
Assignees

Comments

@samderanova
Copy link
Contributor

Currently, submitting an application does not properly send it to the backend. The form's action should be set to /api/user/apply.

@samderanova samderanova linked a pull request Dec 16, 2023 that will close this issue
@samderanova samderanova self-assigned this Dec 16, 2023
@taesungh taesungh removed a link to a pull request Dec 16, 2023
@taesungh
Copy link
Member

As noted in #97, the native POST request will work for now, but it would be better to have client-side error handling in case anything goes wrong during the form submission (notably user session expires) in which case we would need to use event.preventDefault and then send the POST request ourselves with axios or alike.

@taesungh
Copy link
Member

Thought we unlinked it from the PR but guess GitHub thought otherwise.
Additional note looking from last year's: the application form contains some write-in "Other" fields which we previously handled with the client-side submission. Since we are using SSR, it may be worth implementing this on the API side since someone could technically have JavaScript disabled. We can revisit this.

@samderanova
Copy link
Contributor Author

samderanova commented Dec 17, 2023

To better handle situations in which a user's session has expired, we should write some additional code to send a request using axios along with error handling to display a notification when the session expires.

As a result, we also need to handle the situation where a user has JavaScript disabled. The axios request would not be sent, so we automatically fall back on native POST requests. If a user has JS disabled and submits without selecting the "Other" radio button for any question that contains such a button, then we can safely continue to process this request in the backend. Otherwise, we should display some 400 status code (see #93) to tell the user to enable JS because the native POST request will send "Other" as the value for the specific question (i.e. major, pronouns, etc.) instead of the actual value the user provided. Note that the user would be seeing this as a raw API response because our page would not be able to handle the response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants