diff --git a/src/modules/contacts/modules/messaging/api/MessagingAPI.js b/src/modules/contacts/modules/messaging/api/MessagingAPI.js index b0894785..733860f6 100644 --- a/src/modules/contacts/modules/messaging/api/MessagingAPI.js +++ b/src/modules/contacts/modules/messaging/api/MessagingAPI.js @@ -49,6 +49,19 @@ const getList = async (params) => { } }; +const deleteItem = async ({ id, parentId }) => { + try { + const response = await service.deleteIMClient(parentId, id); + return applyTransform(response.data, [ + ]); + } catch (err) { + throw applyTransform(err, [ + notify, + ]); + } +}; + export default { getList, + delete: deleteItem, }; diff --git a/src/modules/contacts/modules/messaging/components/the-messaging.vue b/src/modules/contacts/modules/messaging/components/the-messaging.vue index f1bad0fc..d826022e 100644 --- a/src/modules/contacts/modules/messaging/components/the-messaging.vue +++ b/src/modules/contacts/modules/messaging/components/the-messaging.vue @@ -1,6 +1,13 @@ + @@ -42,6 +59,11 @@ import { useI18n } from 'vue-i18n'; import { useStore } from 'vuex'; import { useTableFilters } from '@webitel/ui-sdk/src/modules/Filters/composables/useTableFilters'; import { useTableStore } from '@webitel/ui-sdk/src/modules/TableStoreModule/composables/useTableStore'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { + useDeleteConfirmationPopup +} from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; import ChatGatewayProvider from '@webitel/ui-sdk/src/enums/ChatGatewayProvider/ChatGatewayProvider.enum'; import dummyLight from '../assets/messaging-dummy-light.svg'; @@ -67,11 +89,21 @@ const { headers, error, + deleteData, sort, } = useTableStore(props.namespace); const { filtersNamespace } = useTableFilters(namespace); +const { + isVisible: isConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, +} = useDeleteConfirmationPopup(); + const showDummy = computed(() => !dataList.value.length); const darkMode = computed(() => store.getters['appearance/DARK_MODE']);