detjonmataj/cpp-contester-php

#Backend: Implement users CRUD on API

Closed this issue · 4 comments

Here we should implement users CRUD API as follows:

  • GET /users 200 OK- will get all users
    • for now the filtering will be done through query params
      • GET/users?key=value
      • if key is invalid return 400 bad request.
      • if value not found 404 error
  • POST /users 201 Created - will create a user based on the JSON payload
  • PUT /users 200 OK - update the whole properties of user
  • DELETE /users - delete the user

All operations must be performed using primary key besides GET which can filter by anything besides password since the API WON'T return the user PASSWORD.

Also this endpoint should be /api/users. If there is any error we should return a JSON {"error": "message"}.

@ComputerGeek5 Waiting for #35 and #29 so switching to TO DO

@ComputerGeek5 should we keep as it is or should we use /mode/crud_operation -> with the proper methods of course

Besides get that should be /model

Either way works fine.

@detjonmataj We have to retrieve the changes from #60 and #62 in branch 36-backend-implement-users-crud-on-api before continuing to work on this issue.

@detjonmataj We have to retrieve the changes from #60 and #62 in branch 36-backend-implement-users-crud-on-api before continuing to work on this issue.

Thanks @ComputerGeek5! I have already updated the branch so please run the followings.

git fetch origin
git checkout 36-backend-implement-users-crud-on-api