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 5fb4817e6d
commit 89e0d3b6a4
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();
};

View File

@@ -100,10 +100,7 @@ const agentSchema = new Schema<IAgent>(
},
support_contact: {
type: Schema.Types.Mixed,
default: {
name: '',
email: '',
},
default: undefined,
},
is_promoted: {
type: Boolean,