Skip to main content

Week 4

Goals for the week

Sl. No.Initial GoalsCompleted
1.Finish the implementation of REST API for adding a userDone
2.Solve requested changes on existing PRsPartially
3.Start the implementaion of REST API for modifying user DetailsNot started

Adding a user via REST API

  • The API implementation of the /users POST route to create a new user is done.
  • This task included
    • Creating a new POST route in the index.php file inside www/ui/api directory.
    • Adding a new method AddUser in the UserController class.
    • Trying to re-use the methods that are already used in the static UI.
    • Testing the API via any API platform like postman.

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 ---- req-body-add-user

  • You can expect a response like this req-body-add-user

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 AddUser method 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-user page to adapt the DefaultPlugin rather than FO_Plugin.
    • Since there were errors while migrating the plugin from FO_Plugin to DefaultPlugin, 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.
  • So, next week I'll be picking up the implementaion of REST API for modifying user Details.