From 5d6ef4fa304bb5137c9409f1794257408d1b76c8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 28 Mar 2018 19:09:13 +0900 Subject: [PATCH] oops --- src/api/endpoints/i/favorites.ts | 2 +- src/api/models/favorite.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/endpoints/i/favorites.ts b/src/api/endpoints/i/favorites.ts index 22a439954..9f8becf21 100644 --- a/src/api/endpoints/i/favorites.ts +++ b/src/api/endpoints/i/favorites.ts @@ -39,6 +39,6 @@ module.exports = (params, user) => new Promise(async (res, rej) => { // Serialize res(await Promise.all(favorites.map(async favorite => - await pack(favorite.post) + await pack(favorite.postId) ))); }); diff --git a/src/api/models/favorite.ts b/src/api/models/favorite.ts index 5ba55c4c9..a21c276ff 100644 --- a/src/api/models/favorite.ts +++ b/src/api/models/favorite.ts @@ -1,10 +1,10 @@ import * as mongo from 'mongodb'; import db from '../../db/mongodb'; -const Favorites = db.get('favorites'); +const Favorites = db.get('favorites'); export default Favorites; -export type IFavorites = { +export type IFavorite = { _id: mongo.ObjectID; createdAt: Date; userId: mongo.ObjectID;