I’m struggling with something and haven’t found a solution despite extensive searching. This discussion on GitHub seems the most relevant, but it still doesn’t have a solution for my case.
Based on the main issue discussed in that discussion and the replies, I’ve successfully extended the product entity, extended the API validator. Everything is working fine so far—I can see the custom field in the database, retrieve it via both the store and admin APIs, and even use it in the “Create Product” API endpoint through Postman. The product, along with the custom field, is added successfully when using Postman.
However, when I try to add a new product via the “Add Product” modal in the admin dashboard UI, I receive an error message stating “custom-field is required.” This makes sense since I set it as required. My questions are: how do I pass the newly added custom field to the payload/request body from the “Add Product” modal in the admin dashboard? how do I add admin widget to the “Add Product” modal in order to pass the custom field in the add-product-process?
I also considered selecting the “Publish Product” button using the DOM, setting its display property to “none” or disable it, and then add a new button, also, through the DOM to manually dispatch the product creation using Medusa React hooks. This way, I could add the new property to the request body before sending the POST request, but I don’t think this is a reliable workaround if I can apply it in the first place.
I’d really appreciate it if someone could help.