| 123456789101112131415161718192021222324252627 |
- import mongoose from 'mongoose';
- import { GlobalNotificationSettingType } from '../GlobalNotificationSetting';
- const GlobalNotificationSetting = require('./index');
- const GlobalNotificationSettingClass = GlobalNotificationSetting.class;
- const GlobalNotificationSettingSchema = GlobalNotificationSetting.schema;
- const factory = (crowi) => {
- GlobalNotificationSettingClass.crowi = crowi;
- GlobalNotificationSettingSchema.loadClass(GlobalNotificationSettingClass);
- const GlobalNotificationSettingModel = mongoose.model('GlobalNotificationSetting', GlobalNotificationSettingSchema);
- const GlobalNotificationMailSettingModel = GlobalNotificationSettingModel.discriminator(
- GlobalNotificationSettingType.MAIL,
- new mongoose.Schema({
- toEmail: String,
- }, {
- discriminatorKey: 'type',
- }),
- );
- return GlobalNotificationMailSettingModel;
- };
- export default factory;
|