mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-23 02:36:12 +01:00
bugfix: Enhance Agent and AgentCategory schemas with new fields for category, support contact, and promotion status
This commit is contained in:
parent
f55cdc9b7f
commit
348ee5821e
5 changed files with 57 additions and 100 deletions
|
|
@ -92,6 +92,35 @@ const agentSchema = new Schema<IAgent>(
|
|||
type: [Schema.Types.Mixed],
|
||||
default: [],
|
||||
},
|
||||
category: {
|
||||
type: String,
|
||||
trim: true,
|
||||
index: true,
|
||||
default: 'general',
|
||||
},
|
||||
support_contact: {
|
||||
type: {
|
||||
name: {
|
||||
type: String,
|
||||
minlength: [3, 'Support contact name must be at least 3 characters.'],
|
||||
trim: true,
|
||||
},
|
||||
email: {
|
||||
type: String,
|
||||
match: [
|
||||
/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/,
|
||||
'Please enter a valid email address.',
|
||||
],
|
||||
trim: true,
|
||||
},
|
||||
},
|
||||
default: {},
|
||||
},
|
||||
is_promoted: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
index: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
|
|
|
|||
|
|
@ -36,4 +36,10 @@ export interface IAgent extends Omit<Document, 'model'> {
|
|||
versions?: Omit<IAgent, 'versions'>[];
|
||||
category: string;
|
||||
support_contact?: ISupportContact;
|
||||
category: string;
|
||||
support_contact?: {
|
||||
name?: string;
|
||||
email?: string;
|
||||
};
|
||||
is_promoted?: boolean;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue