forked from verdnatura/salix-front
feat: define new CustomerDescriptorMenu action. Pending reactivity
This commit is contained in:
parent
87928ea7b6
commit
8714be1fa7
|
@ -40,6 +40,16 @@ const sendSms = async (payload) => {
|
|||
notify(error.message, 'positive');
|
||||
}
|
||||
};
|
||||
const updateSubstitutionAllowed = async () => {
|
||||
try {
|
||||
await axios.patch(`Clients/${route.params.id}`, {
|
||||
substitutionAllowed: !$props.customer.substitutionAllowed,
|
||||
});
|
||||
notify('globals.notificationSent', 'positive');
|
||||
} catch (error) {
|
||||
notify(error.message, 'positive');
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -56,6 +66,13 @@ const sendSms = async (payload) => {
|
|||
</RouterLink>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-ripple clickable>
|
||||
<QItemSection @click="updateSubstitutionAllowed()">{{
|
||||
$props.customer.substitutionAllowed
|
||||
? t('Disable substitution')
|
||||
: t('Allow substitution')
|
||||
}}</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-ripple clickable>
|
||||
<QItemSection @click="showSmsDialog()">{{ t('Send SMS') }}</QItemSection>
|
||||
</QItem>
|
||||
|
|
Loading…
Reference in New Issue