The Error:
- When I perform a POST request to the 'material' endpoint, I get confirmation that a relationship has been established, but when I check the database the 'uniqueCookingEffectId' column has a NULL value in the 'material' table. (EDIT: The first bullet has been solved).
- There is no corresponding column in 'unique_cooking_effect' that shows there are potentially many 'material' records that share that same 'unique_cooking_effect'. (EDIT: The second bullet has been solved).
Expected Behavior: When a User makes a POST request to the 'material' endpoint, the API will check to see if there's a match to a record in the 'unique_cooking_effect' table based on name. If such a value exists, a one-to-many / many-to-one connection is made between those two record rows and those key / foreign key relations are established in the DB.
Reproduction Steps: Reproduction steps have been provided in a subsequent comment as I will hit the character limit otherwise.
Additional Notes: I have a feeling that the Root Cause of this is that I'm not creating an appropriate relationship between the tables for TypeORM or NestJS to know that a relationship should exist and be recorded. Unfortunately, I'm not able to test this as when I try to move the 'UniqueCookingEffectsService' into the 'TypeORM.forFeature()' method NestJS throws an error.