Shun Miyazawa 4 лет назад
Родитель
Сommit
10152aabb3
1 измененных файлов с 6 добавлено и 8 удалено
  1. 6 8
      src/server/models/slack-app-integration.js

+ 6 - 8
src/server/models/slack-app-integration.js

@@ -1,5 +1,10 @@
 const crypto = require('crypto');
+const mongoose = require('mongoose');
 
+const schema = new mongoose.Schema({
+  tokenGtoP: { type: String, required: true, unique: true },
+  tokenPtoG: { type: String, required: true, unique: true },
+});
 class SlackAppIntegration {
 
   static generateAccessToken(user) {
@@ -13,12 +18,5 @@ class SlackAppIntegration {
 }
 
 module.exports = function(crowi) {
-  const mongoose = require('mongoose');
-
-  const slackAppIntegrationSchema = new mongoose.Schema({
-    tokenGtoP: { type: String, required: true, unique: true },
-    tokenPtoG: { type: String, required: true, unique: true },
-  });
-
-  return mongoose.model('SlackAppIntegration', slackAppIntegrationSchema);
+  return mongoose.model('SlackAppIntegration', schema);
 };