summaryrefslogtreecommitdiff
path: root/src/api/common/watch-post.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/common/watch-post.ts')
-rw-r--r--src/api/common/watch-post.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/api/common/watch-post.ts b/src/api/common/watch-post.ts
index 1a50f0edaa..61ea444430 100644
--- a/src/api/common/watch-post.ts
+++ b/src/api/common/watch-post.ts
@@ -3,15 +3,15 @@ import Watching from '../models/post-watching';
export default async (me: mongodb.ObjectID, post: object) => {
// 自分の投稿はwatchできない
- if (me.equals((post as any).user_id)) {
+ if (me.equals((post as any).userId)) {
return;
}
// if watching now
const exist = await Watching.findOne({
- post_id: (post as any)._id,
- user_id: me,
- deleted_at: { $exists: false }
+ postId: (post as any)._id,
+ userId: me,
+ deletedAt: { $exists: false }
});
if (exist !== null) {
@@ -19,8 +19,8 @@ export default async (me: mongodb.ObjectID, post: object) => {
}
await Watching.insert({
- created_at: new Date(),
- post_id: (post as any)._id,
- user_id: me
+ createdAt: new Date(),
+ postId: (post as any)._id,
+ userId: me
});
};