fix: make support_contact field a nested object rather than a sub-document

This commit is contained in:
Danny Avila 2025-07-15 10:12:42 -04:00
parent d971235d2f
commit 5fb4817e6d
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
3 changed files with 23 additions and 14 deletions

View file

@ -99,21 +99,11 @@ const agentSchema = new Schema<IAgent>(
default: 'general',
},
support_contact: {
type: {
name: {
type: String,
trim: true,
},
email: {
type: String,
match: [
/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/,
'Please enter a valid email address.',
],
trim: true,
},
type: Schema.Types.Mixed,
default: {
name: '',
email: '',
},
default: {},
},
is_promoted: {
type: Boolean,