Hey all, I'm trying to add a hook to a text field that takes in a location string and uses it to fetch a geoJson object which is then stored in a hidden field called geoJson. This part is working great, but I am having trouble deleting the geoJson object when the field is cleared.
In the hook, I am taking in a few arguments { operation, value, originalDoc, data } and I can manipulate the data object, but when I try to set the data.geoJson field to null or undefined or even just delete data.geoJson the submission works but the data remains in place. If I instead update the field to say an empty object, that will work. I'm just not seeing how to just remove it completely.
I believe I could use the localAPI to update the field, but I'm thinking that there is probably a way to do so in the data object from the hook.