Week 4
Goals for the week
| Sl. No. | Initial Goals | Completed |
|---|---|---|
| 1. | Finish the implementation of REST API for adding a user | Done |
| 2. | Solve requested changes on existing PRs | Partially |
| 3. | Start the implementaion of REST API for modifying user Details | Not started |
Adding a user via REST API
- The API implementation of the
/usersPOST route to create a new user is done. - This task included
- Creating a new POST route in the
index.phpfile insidewww/ui/apidirectory. - Adding a new method
AddUserin theUserControllerclass. - Trying to re-use the methods that are already used in the static UI.
- Testing the API via any API platform like postman.
- Creating a new POST route in the
PR Link : feat(API): users/ POST route for adding a new user #2256
Testing the PR
-
Pull the changes from the above PR.
-
Use any API platform like postman.
-
Provide the request body as following ----

-
You can expect a response like this

Conclusions and further plans
- After reviewing my PR, Gaurav sir pointed out few issues in the current contribution and code changes. Some of these were ----
- There was duplication of code in the
AddUsermethod as there was no way to re-use the existing functions according to me. - Gaurav sir cleared the misconception that I had, and suggested to patch the existing
add-userpage to adapt theDefaultPluginrather thanFO_Plugin.- Link to the discussion - https://github.com/fossology/fossology/pull/2256#discussion_r920026585
- Since there were errors while migrating the plugin from
FO_PlugintoDefaultPlugin, It was decided in the UI Meeting that any further changes to this PR is paused for now untill we find a patch for this.
- There was duplication of code in the
- So, next week I'll be picking up the implementaion of REST API for modifying user Details.