diff --git a/src/api/conversations.js b/src/api/conversations.js
index 7029b5d7..c141d294 100644
--- a/src/api/conversations.js
+++ b/src/api/conversations.js
@@ -123,3 +123,8 @@ export async function getAllCallsOrVoicemails (options) {
params: options
})
}
+
+export async function deleteFax (id) {
+ const res = await Vue.http.delete('api/faxes/' + id)
+ return res.status >= 200
+}
diff --git a/src/components/pages/Conversations/CscConversationItem.vue b/src/components/pages/Conversations/CscConversationItem.vue
index 12b6db54..c4c0b5ca 100644
--- a/src/components/pages/Conversations/CscConversationItem.vue
+++ b/src/components/pages/Conversations/CscConversationItem.vue
@@ -18,6 +18,7 @@
:call-available="callAvailable"
@download-fax="downloadFax"
@start-call="startCall"
+ @delete-fax="$emit('delete-fax', $event)"
/>
+
@@ -64,9 +67,10 @@
import CscMoreMenu from 'components/CscMoreMenu'
import CscPopupMenuItem from 'components/CscPopupMenuItem'
import CscPopupMenuItemStartCall from 'components/CscPopupMenuItemStartCall'
+import CscPopupMenuItemDelete from 'components/CscPopupMenuItemDelete'
export default {
name: 'CscFaxItem',
- components: { CscPopupMenuItemStartCall, CscPopupMenuItem, CscMoreMenu },
+ components: { CscPopupMenuItemStartCall, CscPopupMenuItem, CscMoreMenu, CscPopupMenuItemDelete },
props: {
fax: {
type: Object,
@@ -105,7 +109,10 @@ export default {
},
startCall () {
this.$emit('start-call', this.fax.caller)
- }
+ },
+ deleteFax (fax) {
+ this.$emit('delete-fax', fax)
+ },
}
}
diff --git a/src/pages/CscPageConversations.vue b/src/pages/CscPageConversations.vue
index fe9d5c1c..962bba0e 100644
--- a/src/pages/CscPageConversations.vue
+++ b/src/pages/CscPageConversations.vue
@@ -71,6 +71,7 @@
@toggle-block-outgoing="toggleBlockOutgoingAction"
@toggle-block-both="toggleBlockBothAction"
@delete-voicemail="$refs.confirmDeletionDialog.open();deletionId=$event.id"
+ @delete-fax="$refs.confirmDeletionFaxDialog.open();deletionId=$event.id"
/>
+
@@ -239,7 +249,8 @@ export default {
deleteVoicemail: 'csc-conversations',
toggleBlockIncoming: 'csc-conversations',
toggleBlockOutgoing: 'csc-conversations',
- toggleBlockBoth: 'csc-conversations'
+ toggleBlockBoth: 'csc-conversations',
+ deleteFax: 'csc-conversations'
}),
...mapMutations('conversations', [
'resetList'
@@ -335,6 +346,14 @@ export default {
this.forceReload()
}
},
+ async deleteFaxConfirmed (payload) {
+ this.resetList()
+ try {
+ await this.deleteFax(payload)
+ } finally {
+ this.forceReload()
+ }
+ },
blockedIncoming (item) {
if (item.direction === 'out') {
return this.isNumberIncomingBlocked(item.callee)
diff --git a/src/store/conversations/actions.js b/src/store/conversations/actions.js
index 4a7faaff..55db9b0d 100644
--- a/src/store/conversations/actions.js
+++ b/src/store/conversations/actions.js
@@ -5,7 +5,8 @@ import {
getConversations,
getIncomingBlocked,
getOutgoingBlocked,
- playVoiceMail
+ playVoiceMail,
+ deleteFax
} from 'src/api/conversations'
import _ from 'lodash'
import {
@@ -208,5 +209,14 @@ export default {
} catch (err) {
context.commit('deletionFailed', err.message)
}
+ },
+ async deleteFax (context, options) {
+ context.commit('deletionRequesting')
+ try {
+ await deleteFax(options.id)
+ context.commit('deletionSucceeded')
+ } catch (err) {
+ context.commit('deletionFailed', err.message)
+ }
}
}