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

API models and endpoints #13

Merged
merged 15 commits into from
Mar 23, 2020
Merged

API models and endpoints #13

merged 15 commits into from
Mar 23, 2020

Conversation

chriskrez
Copy link
Collaborator

About

This PR contains the models (entities) that our project will support and the corresponding endpoints. Also, contains the implementation of the following requests :

  • GET /users/me/profile
  • GET /users/:user_id/profile
  • POST /auth/login
  • POST /auth/signup
  • POST /contact/

Models

  • User
  • Team : Except for users, our platform supports teams that can organize an action, too.
  • Action : This model represents the action organized.
  • Category : Each action can be described by one or more categories, e.g. environment.
  • ContactForm : Our platform supports contact form in which questions can be submitted.
  • Search : Search method to be decided (Searchbar's searching method. #9)

Each model and its fields are described here.

Endpoints

Each model has a number of endpoints to support the necessary functionality.
All endpoints are described here.

Middlewares

There are also four more middlewares added in this PR (NOT implemented yet), mainly for checking the permissions of a user to use specific requests.

  • check-admin : This middleware checks if the user is the admin of the site. It is used for the approval or rejection of an action.
  • check-owner : This middleware is used during the creation of an action by a team. It is used to check if the creator of the action is the owner of the team, too.
  • check-permissions : This middleware checks if the user has the permissions to change the information of an action. Regarding teams, we have to decide if only the owner can change the info or a member can do it, too.
  • log-search: This middleware logs the searches of users.

Signup

Some changes were made in sign up, too.
Usernames are now unique and this closes #11.
Error messages are fixed, too. Errors caused by invalid email, existing email or already used username are being caught and the appropriate error message is sent. This closes #10, too.

@din0s din0s added the enhancement New feature or request label Mar 22, 2020
@din0s din0s added this to the Working backend milestone Mar 22, 2020
@din0s din0s merged commit 233979a into master Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Usernames aren't unique Invalid email on signup leads to 500
4 participants