POST & PUT methods implementation
Hello,
Could you please clarify how to implement post method with a use case, because post method requires request body(json) and our UseCase<T, Params> doesn't support a Model to be passed to data layer.
For example : what if you want to add a User in to your cloud database, how to build use case in order to post User json string to your cloud.
Thank you.
Why do you say the current solution doesn't allow you to pass an entire model? You just have to set it as a filed in your Param object. Just remember that this model should be from the domain layer so you don't break the architecture.
Remember, you should not passed a json to your use case let the data layer decide how it will serialize the data. What you could do, depending on the complexity of the object you want to store is either pass each field as a Param field or you could have the press.ration layer send a whole model (business model) as a Parm field.
yeap, you are right, i've implemented what you've suggested just after I opened the topic, but by this way, I need to write another model mapper class for presentation layer model to domain layer model. that's fine. Thank you.
Hello there,
I have a similar question regarding post, delete, edit methods. Should I create a cloudDataStore for each methods like this this.userDataStoreFactory.createCloudDataStore() ?
regards,