fix: added settings store to check is whatsapp enabled
This commit is contained in:
parent
6ca6c009f2
commit
470b14fccb
@ -48,6 +48,10 @@ def parse_mobile_no(mobile_no: str):
|
||||
"""
|
||||
return ''.join([c for c in mobile_no if c.isdigit() or c == '+'])
|
||||
|
||||
@frappe.whitelist()
|
||||
def is_whatsapp_enabled():
|
||||
return frappe.get_cached_value('WhatsApp Settings', 'WhatsApp Settings', 'enabled')
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_whatsapp_messages(reference_doctype, reference_name):
|
||||
messages = frappe.get_all(
|
||||
|
||||
13
frontend/src/stores/settings.js
Normal file
13
frontend/src/stores/settings.js
Normal file
@ -0,0 +1,13 @@
|
||||
import { createResource } from 'frappe-ui'
|
||||
import { ref } from 'vue'
|
||||
|
||||
export const whatsappEnabled = ref(false)
|
||||
|
||||
createResource({
|
||||
url: 'crm.api.whatsapp.is_whatsapp_enabled',
|
||||
cache: 'Is Whatsapp Enabled',
|
||||
auto: true,
|
||||
onSuccess: (data) => {
|
||||
whatsappEnabled.value = data
|
||||
},
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user