mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 20:21:10 -04:00
Add New SweetAlert & Notification Components
This commit is contained in:
committed by
Mohit Panjwani
parent
3f7db2793f
commit
c3d3e5e35f
27
resources/assets/js/store/modules/notification/actions.js
Normal file
27
resources/assets/js/store/modules/notification/actions.js
Normal file
@ -0,0 +1,27 @@
|
||||
import * as types from './mutation-types'
|
||||
|
||||
export const showNotification = ({ commit, dispatch, state }, payload) => {
|
||||
commit(types.SHOW_NOTIFICATION, true)
|
||||
|
||||
if (payload.type) {
|
||||
commit(types.SET_NOTIFICATION_TYPE, payload.type)
|
||||
}
|
||||
if (payload.title) {
|
||||
commit(types.SET_TITLE, payload.title)
|
||||
}
|
||||
if (payload.autoHide) {
|
||||
commit(types.SET_AUTO_HIDE, payload.autoHide)
|
||||
}
|
||||
if (payload.message) {
|
||||
commit(types.SET_MESSAGE, payload.message)
|
||||
}
|
||||
}
|
||||
|
||||
export const hideNotification = ({ commit, dispatch, state }) => {
|
||||
commit(types.RESET_DATA)
|
||||
commit(types.HIDE_NOTIFICATION, false)
|
||||
}
|
||||
|
||||
export const resetNotificationData = ({ commit, dispatch, state }) => {
|
||||
commit(types.RESET_DATA)
|
||||
}
|
||||
Reference in New Issue
Block a user