Let's now cover some user functions we need in our service to provide the client with enough ability to manage the user's profile. We want to cover three routes in this section:
- Profile (GET "/*/users"): This route is merely returning the logged-in user.
- Update (PATCH "/*/users"): This route saves new information about this user.
- Delete (DELETE "/*/users"): This route deletes the current user.
Also, we need to create a controller first.
The following four sections will implement the UserController class:
- Preparations
- Profile
- Update
- Delete
Let's discuss these in the following sections.