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: addMember page and #10

Open
JJBai2003 opened this issue Apr 11, 2024 · 0 comments
Open

Frontend + Backend: addMember page and #10

JJBai2003 opened this issue Apr 11, 2024 · 0 comments
Assignees

Comments

@JJBai2003
Copy link
Collaborator

Preparation:

  • Make sure you have the most updated version of main. I added some fields to the schema.
  • Create a new branch from main, name it whatever you want. Make sure all the changes are made in your branch.

Backend: Implement some filtering endpoint

  • This is similar to the getMember endpoint implemented by the other group. Feel free to refer to the format. I will suggest looking into the mongoose find method to learn more about its implementations.
  • Implement two endpoints: (GET)filterByYear and (GET)filterByRoles.
  • filterByYear will take in a JSON with one field, year, i.e. req.body.class will be the parameter to the find mongoose method
  • Similarly, filterByRoles will take in a JSON with one field, role.
  • For both endpoints, we want the returned users to have year or role that matches the filter query in a regular expression patter. Refer to this link for more information: https://stackoverflow.com/questions/38497650/how-to-find-items-using-regex-in-mongoose
  • Test the endpoint in Postman :)

Frontend:

  • Create two new files in client/components, name hemt addMember.js and addMember.css.
  • There is no design for this page, so you can be as creative as you want with this one, but make sure there are text fields covering ALL the necessary information for adding a user, i.e. name, email, year, and role.
  • ps. “id” will be generated automatically by the database so we won’t need to manually add it.
    Have fun with this, and let me know if you have any questions :))
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

No branches or pull requests

3 participants