GlobalNotificationMailSetting.js 744 B

12345678910111213141516
  1. const mongoose = require('mongoose');
  2. const GlobalNotificationSetting = require('./index');
  3. const GlobalNotificationSettingClass = GlobalNotificationSetting.class;
  4. const GlobalNotificationSettingSchema = GlobalNotificationSetting.schema;
  5. module.exports = function(crowi) {
  6. GlobalNotificationSettingClass.crowi = crowi;
  7. GlobalNotificationSettingSchema.loadClass(GlobalNotificationSettingClass);
  8. const GlobalNotificationSettingModel = mongoose.model('GlobalNotificationSetting', GlobalNotificationSettingSchema);
  9. const GlobalNotificationMailSettingModel = GlobalNotificationSettingModel.discriminator('mail', new mongoose.Schema({
  10. toEmail: String,
  11. }, {discriminatorKey: 'type'}));
  12. return GlobalNotificationMailSettingModel;
  13. };