From ce7efc4dbb9dca05b6b99b5ada22205890ca823f Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Mon, 2 Apr 2018 17:11:14 +0900 Subject: Distribute posts from remote --- src/server/api/common/watch-post.ts | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 src/server/api/common/watch-post.ts (limited to 'src/server/api/common') diff --git a/src/server/api/common/watch-post.ts b/src/server/api/common/watch-post.ts deleted file mode 100644 index 83c9b94f3e..0000000000 --- a/src/server/api/common/watch-post.ts +++ /dev/null @@ -1,26 +0,0 @@ -import * as mongodb from 'mongodb'; -import Watching from '../../../models/post-watching'; - -export default async (me: mongodb.ObjectID, post: object) => { - // 自分の投稿はwatchできない - if (me.equals((post as any).userId)) { - return; - } - - // if watching now - const exist = await Watching.findOne({ - postId: (post as any)._id, - userId: me, - deletedAt: { $exists: false } - }); - - if (exist !== null) { - return; - } - - await Watching.insert({ - createdAt: new Date(), - postId: (post as any)._id, - userId: me - }); -}; -- cgit v1.2.3-freya