diff --git a/src/api/endpoints/i/favorites.ts b/src/api/endpoints/i/favorites.ts index 22a4399540..9f8becf218 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 5ba55c4c9f..a21c276ff5 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;