diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-02-02 08:21:30 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-02-02 08:21:30 +0900 |
| commit | 718060dc855e09f270b8e19c089ed3c3743665e0 (patch) | |
| tree | 334ea8c7dcd04153da311cf6073407f6f14eb423 /src/api/common | |
| parent | wip (diff) | |
| download | sharkey-718060dc855e09f270b8e19c089ed3c3743665e0.tar.gz sharkey-718060dc855e09f270b8e19c089ed3c3743665e0.tar.bz2 sharkey-718060dc855e09f270b8e19c089ed3c3743665e0.zip | |
wip
Diffstat (limited to 'src/api/common')
| -rw-r--r-- | src/api/common/add-file-to-drive.ts | 4 | ||||
| -rw-r--r-- | src/api/common/notify.ts | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/api/common/add-file-to-drive.ts b/src/api/common/add-file-to-drive.ts index 23cbc44e61..1ee455c092 100644 --- a/src/api/common/add-file-to-drive.ts +++ b/src/api/common/add-file-to-drive.ts @@ -12,7 +12,7 @@ import prominence = require('prominence'); import DriveFile, { getGridFSBucket } from '../models/drive-file'; import DriveFolder from '../models/drive-folder'; -import serialize from '../serializers/drive-file'; +import { pack } from '../models/drive-file'; import event, { publishDriveStream } from '../event'; import config from '../../conf'; @@ -282,7 +282,7 @@ export default (user: any, file: string | stream.Readable, ...args) => new Promi log(`drive file has been created ${file._id}`); resolve(file); - serialize(file).then(serializedFile => { + pack(file).then(serializedFile => { // Publish drive_file_created event event(user._id, 'drive_file_created', serializedFile); publishDriveStream(user._id, 'file_created', serializedFile); diff --git a/src/api/common/notify.ts b/src/api/common/notify.ts index 2b79416a30..ae5669b84c 100644 --- a/src/api/common/notify.ts +++ b/src/api/common/notify.ts @@ -2,7 +2,7 @@ import * as mongo from 'mongodb'; import Notification from '../models/notification'; import Mute from '../models/mute'; import event from '../event'; -import serialize from '../serializers/notification'; +import { pack } from '../models/notification'; export default ( notifiee: mongo.ObjectID, @@ -27,7 +27,7 @@ export default ( // Publish notification event event(notifiee, 'notification', - await serialize(notification)); + await pack(notification)); // 3秒経っても(今回作成した)通知が既読にならなかったら「未読の通知がありますよ」イベントを発行する setTimeout(async () => { @@ -44,7 +44,7 @@ export default ( } //#endregion - event(notifiee, 'unread_notification', await serialize(notification)); + event(notifiee, 'unread_notification', await pack(notification)); } }, 3000); }); |