refactor: Update support_contact field initialization in agent model

- Removed handling for empty support_contact object in createAgent function.
- Changed default value of support_contact in agent schema to undefined.
This commit is contained in:
Danny Avila 2025-07-15 11:23:41 -04:00
parent b750f52727
commit 98de99d9ac
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
2 changed files with 1 additions and 12 deletions

View file

@ -39,14 +39,6 @@ const createAgent = async (agentData) => {
category: agentData.category || 'general',
};
// Handle empty support_contact object
if (agentData.support_contact && Object.keys(agentData.support_contact).length === 0) {
initialAgentData.support_contact = {
name: '',
email: '',
};
}
return (await Agent.create(initialAgentData)).toObject();
};