feat: add likes

+ add ability for user to like a posts
+ add ability for user ot remove a like
+ add display of reply and like count
This commit is contained in:
Stevan Freeborn
2023-09-14 23:02:47 -05:00
parent 9cc9077017
commit 40515b3099
8 changed files with 161 additions and 12 deletions
+6
View File
@@ -42,6 +42,12 @@ export default defineSchema(
})
.index('by_user_id', ['userId'])
.index('by_parent_id', ['parentPostId']),
likes: defineTable({
postId: v.id('posts'),
userId: v.id('users'),
})
.index('by_user_post_id', ['userId', 'postId'])
.index('by_post_user_id', ['postId', 'userId']),
},
{ schemaValidation: false }
);