How to submit a form with 3 submit buttons using ajax without redirecting to the form action url in Laravel?

I have here a datatable with a form inside that has 3 submit buttons. I did a switch statement which it checks what submit button was clicked, then performs the operation of that submit button on my store() function. Currently, I’m trying to submit the form using ajax. If I remove the switch statement, and just return one operation/function.e.g. saveCredit(), then it saves data in the database. However, with switch statement, in place, it doesn’t save any data.