From c4a4f7fcd632bbc99d9a46c4ff546f6e64a2c7f1 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 14 Nov 2024 11:20:16 +0100 Subject: [PATCH] refactor: refs #6818 change channel source --- src/components/ui/VnLinkPhone.vue | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/components/ui/VnLinkPhone.vue b/src/components/ui/VnLinkPhone.vue index 3b63889e1..4c045968f 100644 --- a/src/components/ui/VnLinkPhone.vue +++ b/src/components/ui/VnLinkPhone.vue @@ -17,19 +17,12 @@ const config = reactive({ const type = Object.keys(config).find((key) => key in useAttrs()) || 'sip'; onBeforeMount(async () => { - let url; let { channel } = config[type]; if (type === 'say-simple') { - url = (await axios.get('SaySimpleConfigs/findOne')).data.url; - if (!channel) - channel = ( - await axios.get('SaySimpleCountries/findOne', { - params: { - filter: { fields: ['channel'], where: { countryFk: 0 } }, - }, - }) - ).data?.channel; + const { url, defaultChannel } = (await axios.get('SaySimpleConfigs/findOne')) + .data; + if (!channel) channel = defaultChannel; config[ type