Explorar el Código

import Activity model and added models setUp

kaori hace 4 años
padre
commit
7fbe2f9c8f

+ 10 - 1
packages/app/src/server/crowi/index.js

@@ -18,6 +18,7 @@ import AclService from '../service/acl';
 import AttachmentService from '../service/attachment';
 import { SlackIntegrationService } from '../service/slack-integration';
 import { UserNotificationService } from '../service/user-notification';
+import Actiity from '../models/activity';
 
 const logger = loggerFactory('growi:crowi');
 const httpErrorHandler = require('../middlewares/http-error-handler');
@@ -300,7 +301,15 @@ Crowi.prototype.setupSocketIoService = async function() {
 };
 
 Crowi.prototype.setupModels = async function() {
-  Object.keys(models).forEach((key) => {
+  let allModels = {};
+
+  // include models that dependent on crowi
+  allModels = models;
+
+  // include models that independent from crowi
+  allModels.Activity = Actiity;
+
+  Object.keys(allModels).forEach((key) => {
     return this.model(key, models[key](this));
   });
 };

+ 0 - 3
packages/app/src/server/models/index.js

@@ -1,5 +1,3 @@
-import Activity from './activity';
-
 module.exports = {
   Page: require('./page'),
   // TODO GW-2746 bulk export pages
@@ -19,5 +17,4 @@ module.exports = {
   GlobalNotificationSlackSetting: require('./GlobalNotificationSetting/GlobalNotificationSlackSetting'),
   ShareLink: require('./share-link'),
   SlackAppIntegration: require('./slack-app-integration'),
-  Activity,
 };