Answer the question
In order to leave comments, you need to log in
How to correctly organize API using REST and SOLID when partially updating an entity?
It is necessary to ensure that the photo and information about the user is uploaded to the server. Currently, the user information and photo are saved to the server by two different requests (one method = one action) and are processed in the same way on the server. The update action for an entity within the REST framework must be performed using a PUT request. Which option is better to choose:
1. Run the same request for both actions, on the server, depending on the passed parameters passed to the update() method of the controller, call updateInfo() or updatePhoto()
2. Add an action parameter to the request?
3. Create classes on the server to manage file operations and generate queries like /user/4/image/?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question