From 1889979fd57220bb70d48f079f43a2a3dd0bf08e Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 17 Jan 2017 09:17:52 +0900 Subject: [PATCH] Fix bug --- src/api/common/add-file-to-drive.ts | 1 + src/api/event.ts | 1 + src/api/models/notification.ts | 4 +++- src/api/private/signin.ts | 1 + src/api/serializers/app.ts | 1 + src/api/serializers/drive-file.ts | 1 + src/api/serializers/user.ts | 1 + src/api/streaming.ts | 1 + 8 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/api/common/add-file-to-drive.ts b/src/api/common/add-file-to-drive.ts index 4102d6425..e001216ee 100644 --- a/src/api/common/add-file-to-drive.ts +++ b/src/api/common/add-file-to-drive.ts @@ -7,6 +7,7 @@ import DriveFile from '../models/drive-file'; import DriveFolder from '../models/drive-folder'; import serialize from '../serializers/drive-file'; import event from '../event'; +import config from '../../conf'; /** * Add file to drive diff --git a/src/api/event.ts b/src/api/event.ts index 584fc8e86..58b3260d5 100644 --- a/src/api/event.ts +++ b/src/api/event.ts @@ -1,5 +1,6 @@ import * as mongo from 'mongodb'; import * as redis from 'redis'; +import config from '../conf'; type ID = string | mongo.ObjectID; diff --git a/src/api/models/notification.ts b/src/api/models/notification.ts index 1cb7b8083..b53db4f0b 100644 --- a/src/api/models/notification.ts +++ b/src/api/models/notification.ts @@ -1 +1,3 @@ -export default global.db.collection('notifications'); +import db from '../../db/mongodb'; + +export default db.collection('notifications'); diff --git a/src/api/private/signin.ts b/src/api/private/signin.ts index 0ff3471bb..4c592d5cf 100644 --- a/src/api/private/signin.ts +++ b/src/api/private/signin.ts @@ -4,6 +4,7 @@ import User from '../models/user'; import Signin from '../models/signin'; import serialize from '../serializers/signin'; import event from '../event'; +import config from '../../conf'; export default async (req: express.Request, res: express.Response) => { res.header('Access-Control-Allow-Credentials', 'true'); diff --git a/src/api/serializers/app.ts b/src/api/serializers/app.ts index b60bcb97e..5c41646be 100644 --- a/src/api/serializers/app.ts +++ b/src/api/serializers/app.ts @@ -8,6 +8,7 @@ import deepcopy = require('deepcopy'); import App from '../models/app'; import User from '../models/user'; import AccessToken from '../models/access-token'; +import config from '../../conf'; /** * Serialize an app diff --git a/src/api/serializers/drive-file.ts b/src/api/serializers/drive-file.ts index 76d66ce6f..a0c410e32 100644 --- a/src/api/serializers/drive-file.ts +++ b/src/api/serializers/drive-file.ts @@ -7,6 +7,7 @@ import * as mongo from 'mongodb'; import DriveFile from '../models/drive-file'; import serializeDriveTag from './drive-tag'; import deepcopy = require('deepcopy'); +import config from '../../conf'; /** * Serialize a drive file diff --git a/src/api/serializers/user.ts b/src/api/serializers/user.ts index 9eca8bbb7..cb698203b 100644 --- a/src/api/serializers/user.ts +++ b/src/api/serializers/user.ts @@ -8,6 +8,7 @@ import deepcopy = require('deepcopy'); import User from '../models/user'; import Following from '../models/following'; import getFriends from '../common/get-friends'; +import config from '../../conf'; /** * Serialize a user diff --git a/src/api/streaming.ts b/src/api/streaming.ts index 7a8d2d435..32daf872f 100644 --- a/src/api/streaming.ts +++ b/src/api/streaming.ts @@ -1,6 +1,7 @@ import * as http from 'http'; import * as websocket from 'websocket'; import * as redis from 'redis'; +import config from '../conf'; import User from './models/user'; import AccessToken from './models/access-token'; import isNativeToken from './common/is-native-token';