mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-29 12:41:10 -04:00
29 lines
664 B
JavaScript
29 lines
664 B
JavaScript
import * as types from './mutation-types'
|
|
|
|
export const openModal = ({ commit, dispatch, state }, payload) => {
|
|
commit(types.SET_COMPONENT_NAME, payload.componentName)
|
|
commit(types.SHOW_MODAL, true)
|
|
|
|
if (payload.id) {
|
|
commit(types.SET_ID, payload.id)
|
|
}
|
|
commit(types.SET_TITLE, payload.title)
|
|
|
|
if (payload.data) {
|
|
commit(types.SET_DATA, payload.data)
|
|
}
|
|
|
|
if (payload.size) {
|
|
commit(types.SET_SIZE, payload.size)
|
|
}
|
|
}
|
|
|
|
export const closeModal = ({ commit, dispatch, state }) => {
|
|
commit(types.RESET_DATA)
|
|
commit(types.HIDE_MODAL, false)
|
|
}
|
|
|
|
export const resetModalData = ({ commit, dispatch, state }) => {
|
|
commit(types.RESET_DATA)
|
|
}
|