-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
Description / Steps to reproduce / Feature proposal
As I was working on the user order history component for https://github.com/strongloop/loopback4-example-shopping I ran into an issue I thought LoopBack would've taken care of for me -- referential integrity with the @hasMany relation.
Current Behavior
I am able to create an order using /post/{userId}/orders for a userId which is not that of a user. I would've expected some sort of a check that would've ensure that the userId exists.
Expected Behavior
Throw an error for an userId not in the database.
Acceptance Criteria
For longer term, we can look into a better way to handle referential integrity. For now:
- check the database whether the userId exist and then make the post call
See Reporting Issues for more tips on writing good issues