feat: Contact merge

This commit is contained in:
iamsivin
2024-11-06 21:08:14 +05:30
parent 703b36e38c
commit 28cbdb6133
7 changed files with 253 additions and 8 deletions
@@ -121,10 +121,10 @@ const getFormBinding = key => {
// Example 2 (root): field = 'email' returns state.email = "john@example.com"
get: () => {
if (field === 'firstName' || field === 'lastName') {
return state[field];
return state[field]?.toString() || '';
}
const [base, nested] = field.split('.');
return nested ? state[base][nested] : state[base];
return (nested ? state[base][nested] : state[base])?.toString() || '';
},
// Set value in state and emit update