mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 19:30:15 +01:00
fix: make support_contact field a nested object rather than a sub-document
This commit is contained in:
parent
39f4e725e5
commit
b750f52727
3 changed files with 23 additions and 14 deletions
|
|
@ -38,6 +38,15 @@ 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();
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue