On the first button, the query keys are accessible on the named action which is a showCardmodal action.
However, On the second button, I am calling a showmodal named action but the same query keys are not passed to the hook. I think maybe I should set the key to the app when using showModal?
Thanks for this. When you call a named action like you’ve done, the options that you pass are merged into the root level of the options object. For your first action, this is fine because that’s where you expect the query object to be. However, for your showModal action, you actually want that data in the sub-action under the slots.
I overcome this by adding a function key to the showModal action that copies the data where I want it to go. So your 2nd named action would look something like:
The function always runs prior to the actual action, so this way your parameters will be inside the runUtilityHook action if you press the delete button in that modal.
If you have any trouble implementing this, add a debugger; statement to the beginning of that function and open the browser developer tools to debug the Javascript before launching the action. It will pause before executing that code so you can inspect the object and make sure the path is correct.