Skip to main content

Week 6

Goals for the week

Sl. No.Initial GoalsCompleted
1.Solve requested changes on existing PRsDone
2.Resume the implementation of API to add a userPending (Docs)
3.API for changing the upload permissionsNot Started

Requested changes and modifications


For the Edit User Api

  1. Changing the request format to be more simplified ---

    • From this req-body-edit-user
    • To this req-body-edit-user-updated
  2. Modify the backend function to allow the user to send the only field which he/she wants to modify(edit). For instance, If the user wants to update the description he will just give the userId in params in path, and description field in the request body. All other fields which are not given in the request body will be automatically set in the backend from the DB. Refer to the discussion here.

New API for adding a user (Started)

  • Gaurav sir sent me the patch that converted the user_add plugin to extend from DefaultPlugin rather than FO_Plugin.
  • This enabled me to use this plugin's existing methods to add a user which prevented code duplication and repetition of logic.
  • This Implementation included the following tasks ---
    • Create a new POST /users route in the index.php file inside www/ui/api directory.
    • Add a new method AddUser in the UserController.php file.
    • Try to re-use the methods that are already used in the user-add plugin.

Testing POST /users

  • Use any API platform like postman.
  • Pull the changes from this PR.
  • Provide the request body as following ---- req-body-add-user
  • You can expect a response like this res-body-add-user

Conclusions and further plans

  • Complete the implementation of POST /users API to add a new user and document everything in openapi.yaml file.
  • Start figuring out the requirements for the implementation of upload-permisions API for modifying the upload permissions of each group for a upload and design the API in swagger docs..