mirror of
https://github.com/crater-invoice/crater.git
synced 2026-02-09 12:22:40 -05:00
build version 400
This commit is contained in:
22
resources/assets/js/store/modules/notes/mutations.js
Normal file
22
resources/assets/js/store/modules/notes/mutations.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import * as types from './mutation-types'
|
||||
|
||||
export default {
|
||||
[types.BOOTSTRAP_NOTES](state, notes) {
|
||||
state.notes = notes
|
||||
},
|
||||
|
||||
[types.ADD_NOTE](state, data) {
|
||||
state.notes.push(data.note)
|
||||
},
|
||||
|
||||
[types.UPDATE_NOTE](state, data) {
|
||||
let pos = state.notes.findIndex((note) => note.id === data.note.id)
|
||||
|
||||
state.notes[pos] = data.note
|
||||
},
|
||||
|
||||
[types.DELETE_NOTE](state, id) {
|
||||
let index = state.notes.findIndex((note) => note.id === id)
|
||||
state.notes.splice(index, 1)
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user