fix: complex logical expression

This commit is contained in:
Muhsin Keloth
2025-06-11 17:12:52 +05:30
parent a1ce805fa5
commit f0f3e615b3
2 changed files with 13 additions and 5 deletions
+4
View File
@@ -25,11 +25,15 @@ checks:
config:
threshold: 300
method-lines:
enabled: true
config:
threshold: 50
exclude_paths:
- 'app/javascript/dashboard/composables/'
cognitive-complexity:
enabled: true
config:
threshold: 5
exclude_paths:
- 'app/javascript/dashboard/composables/'
exclude_patterns:
@@ -171,6 +171,14 @@ export function useWhatsappEmbeddedSignup() {
}
};
const isValidBusinessData = businessDataLocal => {
return (
businessDataLocal &&
(businessDataLocal.business_id || businessDataLocal.businessId) &&
(businessDataLocal.waba_id || businessDataLocal.wabaId)
);
};
// Message handling
const handleEmbeddedSignupData = async data => {
// Handle different embedded signup events per Facebook documentation
@@ -184,11 +192,7 @@ export function useWhatsappEmbeddedSignup() {
}
// Validate we have the required business information
if (
businessDataLocal &&
(businessDataLocal.business_id || businessDataLocal.businessId) &&
(businessDataLocal.waba_id || businessDataLocal.wabaId)
) {
if (isValidBusinessData(businessDataLocal)) {
// Normalize the data structure to match our backend expectations
const normalizedData = {
business_id: