From d6e68bf1fabbf9471a964815d84b4ab85dfb1b43 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 8 Feb 2017 23:37:37 +0900 Subject: [PATCH] =?UTF-8?q?[API]=20post=E3=81=ABapp=E3=82=92=E5=90=AB?= =?UTF-8?q?=E3=82=81=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/serializers/post.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/api/serializers/post.ts b/src/api/serializers/post.ts index 1805b70ae..5473cd1a0 100644 --- a/src/api/serializers/post.ts +++ b/src/api/serializers/post.ts @@ -6,6 +6,7 @@ import * as mongo from 'mongodb'; import Post from '../models/post'; import Like from '../models/like'; +import serializeApp from './app'; import serializeUser from './user'; import serializeDriveFile from './drive-file'; import deepcopy = require('deepcopy'); @@ -59,6 +60,11 @@ const self = ( // Populate user _post.user = await serializeUser(_post.user_id, me); + // Populate app + if (_post.app_id) { + _post.app = await serializeApp(_post.app_id); + } + if (_post.media_ids) { // Populate media _post.media = await Promise.all(_post.media_ids.map(async fileId =>