Week 6
Goals for the week
Sl. No. | Initial Goals | Completed |
---|---|---|
1. | Solve requested changes on existing PRs | Done |
2. | Resume the implementation of API to add a user | Pending (Docs) |
3. | API for changing the upload permissions | Not Started |
Requested changes and modifications
For the Edit User Api
-
Changing the request format to be more simplified ---
- From this
- To this
-
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 theuserId
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 fromDefaultPlugin
rather thanFO_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 theindex.php
file insidewww/ui/api
directory. - Add a new method
AddUser
in theUserController.php
file. - Try to re-use the methods that are already used in the
user-add
plugin.
- Create a new
Testing POST /users
- Use any API platform like postman.
- Pull the changes from this PR.
- Provide the request body as following ----
- You can expect a response like this
Conclusions and further plans
- Complete the implementation of
POST /users
API to add a new user and document everything inopenapi.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..