21.04 Write Data - When Task Deleted
This commit is contained in:
parent
65b76d2255
commit
f6de60571b
@ -51,8 +51,8 @@ const actions = {
|
||||
updateTask ({ dispatch }, payload) {
|
||||
dispatch('fbUpdateTask', payload)
|
||||
},
|
||||
deleteTask ({ commit }, id) {
|
||||
commit('deleteTask', id)
|
||||
deleteTask ({ dispatch }, id) {
|
||||
dispatch('fbDeleteTask', id)
|
||||
},
|
||||
addTask ({ dispatch }, task) {
|
||||
const taskId = uid()
|
||||
@ -107,6 +107,11 @@ const actions = {
|
||||
const userId = firebaseAuth.currentUser.uid
|
||||
const taskRef = firebaseDb.ref('tasks/' + userId + '/' + payload.id)
|
||||
taskRef.update(payload.updates)
|
||||
},
|
||||
fbDeleteTask ({ commit }, taskId) {
|
||||
const userId = firebaseAuth.currentUser.uid
|
||||
const taskRef = firebaseDb.ref('tasks/' + userId + '/' + taskId)
|
||||
taskRef.remove()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user