diff options
Diffstat (limited to 'src/site/plugins/handler.js')
| -rw-r--r-- | src/site/plugins/handler.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/site/plugins/handler.js b/src/site/plugins/handler.js index 7933eab..f4be79c 100644 --- a/src/site/plugins/handler.js +++ b/src/site/plugins/handler.js @@ -2,14 +2,16 @@ import AlertTypes from '~/constants/alertTypes'; export default ({ store }, inject) => { inject('handler', { - async executeAction(action, param) { + async executeAction(action, param, showSuccess = true) { try { const response = await store.dispatch(action, param); - store.commit('alert/set', { - message: response?.message ?? 'Executed sucesfully', - type: AlertTypes.SUCCESS - }); + if (showSuccess) { + store.commit('alert/set', { + message: response?.message ?? 'Executed sucesfully', + type: AlertTypes.SUCCESS + }); + } return response; } catch (e) { |