Chaining Json form onSubmit

I have some code I want to run whenever a form is submitted, so I’d like to have my own onSubmit handler and then be able to chain or call the default onSubmit handler, but I didn’t see a way to do this. Is the default handler exposed if I provide my own? Thanks.

Does anyone have any ideas? I’m using TinaCMS with gatsby, json, and git. Thanks.

Hey @TorrinLynn you should be able to pass your own onSubmit in and do what the default function does:

onSubmit() {
   return cms.api.git.commit({
       files: [jsoNode.fileRelativePath],
   }).then(() => {
     // Do your thing
   })
}

Thanks @ncphi. I’m trying to avoid duplicating the existing onSubmit. My use case is that I need to geocode an address so that it can be saved with my json. I could do this in the onChange methods, but then I’d be calling the geocoding API too much, so I was hoping to write my own onSubmit which geocoded the address and then call the provided TinaCMS onSubmit method.