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

Frontend: Backend connection for sign up page #438

Merged
merged 2 commits into from
Oct 30, 2022

Conversation

xltvy
Copy link
Contributor

@xltvy xltvy commented Oct 30, 2022

PR Description:

Our sign up page had appropriate form fields and validation check. However, the connection between the frontend of sign up page and our REST API has not been established yet.

This PR provides a trustfully functioning REST API connection between the sign up page and the appropriate endpoint.


Notes:

  • The endpoint used in the sign up form is auth/signup endpoint.
  • Upon an unsuccessful response, the string in the response body's resultMessage field is displayed as an error message below the sign up button, with coherence to the validation error messages in the form fields.

Routine Check

  • I have fetched and pulled the latest version of the parent branch.
  • This PR does not have any conflicts with the parent branch.

@xltvy xltvy added priority-medium Medium level priority issue status-needreview A review to the issue is needed front-end Front-end related items back-connection Connection back-end to mobile/front labels Oct 30, 2022
@xltvy xltvy self-assigned this Oct 30, 2022
@xltvy xltvy linked an issue Oct 30, 2022 that may be closed by this pull request
6 tasks
@xltvy xltvy linked an issue Oct 30, 2022 that may be closed by this pull request
6 tasks
const [message, setMessage] = useState("");

const registerUser = async (username, email, password) => {
await fetch("http://3.75.151.200:3000/auth/signup", {
Copy link
Contributor

Choose a reason for hiding this comment

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

We can put this URL into a .env file and use it from that instead of using it statically on the code since we will need to use this value several times on the front-end project. Also, the backend will deploy the project several times and probably change the URL.

Copy link
Contributor

Choose a reason for hiding this comment

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

probably we will use it like;
await fetch("{process.env.BACKEND_URL}/auth/signup"

@Koraytkn Koraytkn merged commit 5133cf2 into frontend/dev Oct 30, 2022
@Koraytkn
Copy link
Contributor

We have checked for the above review and realized that "adding custom environment variables in react" could be another task instead of a fix for this issue, we will be adding the corresponding issue and initializing a config file in the future. Other than that @xltvy s implementation seems accurate, I am merging this branch to the frontend/dev and closing this pull request.

@egemenatikk egemenatikk added Status: Completed Issue is solved and removed status-needreview A review to the issue is needed labels Oct 30, 2022
@bahricanyesil bahricanyesil deleted the frontend/dev-signup-page-backend-connection branch November 2, 2022 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back-connection Connection back-end to mobile/front front-end Front-end related items priority-medium Medium level priority issue Status: Completed Issue is solved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Frontend: Backend Connection for the Sign Up Page
4 participants