GlobalNotificationSlackSetting.js 753 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 GlobalNotificationSlackSettingModel = GlobalNotificationSettingModel.discriminator('slack', new mongoose.Schema({
  10. slackChannels: String,
  11. }, {discriminatorKey: 'type'}));
  12. return GlobalNotificationSlackSettingModel;
  13. };