VueX - Dispatch action in a different module from an action
If you don't have payload to pass, then you need to send the second parameter as a null
like:
dispatch('ride/clearUserData', null, { root: true })
Your usage of dispatch()
is incorrectly passing { root: true }
as the 2nd argument, which is intended for the payload. Options should be 3rd:
// dispatch('ride/clearUserData', { root: true }) // FIXME: options passed as payload
dispatch('ride/clearUserData', null, { root: true })