jeudi 2 avril 2020

Is it normal to create 2 unrelated(different) resources in one request?

When a user offers friendship to another user, he automatically subscribes to him. How to implement this in REST Api? 2 different entities(aggregates) are created in one request: Friendship (with OFFERED status) and Subscription, but the endpoint is called /friendships. Is it normal that there is such a side effect as a subscription? Or should I implement it differently? Are there recommendations for such situations?

I want the logic to remain the same: automatic subscription occurs when a friendship is offered. Not otherwise.




Aucun commentaire:

Enregistrer un commentaire