diff options
| author | Akihiko Odaki <nekomanma@pixiv.co.jp> | 2018-03-29 01:20:40 +0900 |
|---|---|---|
| committer | Akihiko Odaki <nekomanma@pixiv.co.jp> | 2018-03-29 01:54:41 +0900 |
| commit | 90f8fe7e538bb7e52d2558152a0390e693f39b11 (patch) | |
| tree | 0f830887053c8f352b1cd0c13ca715fd14c1f030 /src/api/common/get-friends.ts | |
| parent | Implement remote account resolution (diff) | |
| download | misskey-90f8fe7e538bb7e52d2558152a0390e693f39b11.tar.gz misskey-90f8fe7e538bb7e52d2558152a0390e693f39b11.tar.bz2 misskey-90f8fe7e538bb7e52d2558152a0390e693f39b11.zip | |
Introduce processor
Diffstat (limited to 'src/api/common/get-friends.ts')
| -rw-r--r-- | src/api/common/get-friends.ts | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/api/common/get-friends.ts b/src/api/common/get-friends.ts deleted file mode 100644 index db6313816d..0000000000 --- a/src/api/common/get-friends.ts +++ /dev/null @@ -1,26 +0,0 @@ -import * as mongodb from 'mongodb'; -import Following from '../models/following'; - -export default async (me: mongodb.ObjectID, includeMe: boolean = true) => { - // Fetch relation to other users who the I follows - // SELECT followee - const myfollowing = await Following - .find({ - follower_id: me, - // 削除されたドキュメントは除く - deleted_at: { $exists: false } - }, { - fields: { - followee_id: true - } - }); - - // ID list of other users who the I follows - const myfollowingIds = myfollowing.map(follow => follow.followee_id); - - if (includeMe) { - myfollowingIds.push(me); - } - - return myfollowingIds; -}; |