From 30d61ec4da89b8fcc02f2d54018885d1c9fb8695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Mon, 5 Nov 2018 11:39:13 +0900 Subject: [PATCH] Separate commits Flash Back 90's --- src/server/api/mastodon.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/server/api/mastodon.ts b/src/server/api/mastodon.ts index d1e1068da..33a0b4b5f 100644 --- a/src/server/api/mastodon.ts +++ b/src/server/api/mastodon.ts @@ -5,18 +5,17 @@ import config from '../../config'; import Meta from '../../models/meta'; import { ObjectID } from 'bson'; import Emoji from '../../models/emoji'; -import { toMastodonEmojis } from '../../models/mastodon/emoji'; const pkg = require('../../../package.json'); // Init router const router = new Router(); router.get('/v1/custom_emojis', async ctx => ctx.body = - (await Emoji.find({ host: null }, { + await Emoji.find({ host: null }, { fields: { _id: false } - })).map(toMastodonEmojis)); + })); router.get('/v1/instance', async ctx => { // TODO: This is a temporary implementation. Consider creating helper methods! const meta = await Meta.findOne() || {}; @@ -41,11 +40,6 @@ router.get('/v1/instance', async ctx => { // TODO: This is a temporary implement notesCount: 0 }; const acct = maintainer.host ? `${maintainer.username}@${maintainer.host}` : maintainer.username; - const emojis = (await Emoji.find({ host: null }, { - fields: { - _id: false - } - })).map(toMastodonEmojis); ctx.body = { uri: config.hostname, @@ -85,7 +79,7 @@ router.get('/v1/instance', async ctx => { // TODO: This is a temporary implement followers_count: maintainer.followersCount, following_count: maintainer.followingCount, statuses_count: maintainer.notesCount, - emojis: emojis, + emojis: [], moved: null, fields: null }