[wip] Implement like activity

This commit is contained in:
syuilo 2018-04-03 00:59:38 +09:00
parent 45fb451111
commit 7da1913964
3 changed files with 50 additions and 2 deletions

View file

@ -5,12 +5,12 @@ import Reaction from './post-reaction';
import { pack as packUser } from './user';
const PostReaction = db.get<IPostReaction>('postReactions');
PostReaction.createIndex(['userId', 'postId'], { unique: true });
export default PostReaction;
export interface IPostReaction {
_id: mongo.ObjectID;
createdAt: Date;
deletedAt: Date;
postId: mongo.ObjectID;
userId: mongo.ObjectID;
reaction: string;