21.03 Write Data - When Task Updated
This commit is contained in:
parent
d09fc4e6ba
commit
f46d10d26f
@ -48,8 +48,8 @@ const mutations = {
|
||||
}
|
||||
|
||||
const actions = {
|
||||
updateTask ({ commit }, payload) {
|
||||
commit('updateTask', payload)
|
||||
updateTask ({ dispatch }, payload) {
|
||||
dispatch('fbUpdateTask', payload)
|
||||
},
|
||||
deleteTask ({ commit }, id) {
|
||||
commit('deleteTask', id)
|
||||
@ -102,6 +102,11 @@ const actions = {
|
||||
const userId = firebaseAuth.currentUser.uid
|
||||
const taskRef = firebaseDb.ref('tasks/' + userId + '/' + payload.id)
|
||||
taskRef.set(payload.task)
|
||||
},
|
||||
fbUpdateTask ({ commit }, payload) {
|
||||
const userId = firebaseAuth.currentUser.uid
|
||||
const taskRef = firebaseDb.ref('tasks/' + userId + '/' + payload.id)
|
||||
taskRef.update(payload.updates)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user