0
0
Fork 0

Merge pull request 'refactor: refs #6818 change channel source' (!932) from 6818-useDefaultChannel into dev

Reviewed-on: verdnatura/salix-front#932
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Jorge Penadés 2024-11-14 10:31:15 +00:00
commit 84802cf267
1 changed files with 3 additions and 10 deletions

View File

@ -17,19 +17,12 @@ const config = reactive({
const type = Object.keys(config).find((key) => key in useAttrs()) || 'sip'; const type = Object.keys(config).find((key) => key in useAttrs()) || 'sip';
onBeforeMount(async () => { onBeforeMount(async () => {
let url;
let { channel } = config[type]; let { channel } = config[type];
if (type === 'say-simple') { if (type === 'say-simple') {
url = (await axios.get('SaySimpleConfigs/findOne')).data.url; const { url, defaultChannel } = (await axios.get('SaySimpleConfigs/findOne'))
if (!channel) .data;
channel = ( if (!channel) channel = defaultChannel;
await axios.get('SaySimpleCountries/findOne', {
params: {
filter: { fields: ['channel'], where: { countryFk: 0 } },
},
})
).data?.channel;
config[ config[
type type