I have at least 3 environments, so to deploy the entries in the differents environments. For tables creation I only generate the model in my local strapi and push the code files generated to the environments, but for the entries I used Flyway; insert the entries in my local strapi UI, generated a script from my local database and import that data with flyway to the environment.
After some weeks of use I notice a issue when I want to create a entries from the UI (screenshots). Someone have encountered with this problem before?
This topic has been created from a Discord post (1286788698477822063) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord
Did you customized create new function?
Did you customize create new function?
Hi <@1177081919641485444>! No, I have not customized that function. I created a function for API consumption though.
Can you share the query used in that function for API consumption?
Here, I created a custom function within the controller called findByParams, which first validates the parameters that come in the query route. Then, in the useFetchByParams function, it calls a service function from the schema itself.
The service, to which I also created a custom function fetchByParams, simply makes a database query to return the information of the corresponding model and, at the same time, handles errors that may occur due to a malformed query, non-existent relationships, etc.
you need to insert break statement inside if condition clause
or write return statement instead of break